@shopify/app-bridge
Version:
[](https://travis-ci.com/Shopify/app-bridge) [](https:
58 lines (39 loc) • 1.94 kB
Markdown
# `@shopify/app-bridge`
[](https://travis-ci.com/Shopify/app-bridge)
[](https://codecov.io/gh/Shopify/app-bridge)
[](LICENSE.md)
[](https://badge.fury.io/js/%40shopify%2Fapp-bridge.svg)
[](https://img.shields.io/bundlephobia/minzip/@shopify/app-bridge.svg)
The App Bridge is a library that enables Apps on Shopify to access native
Shopify features across different platforms.
## Installation
``` sh
yarn add @shopify/app-bridge
```
## Usage
### Set up your app
Import the library from the `@shopify/app-bridge` package and provide
a configuration:
``` ts
import createApp, {getShopOrigin} from '@shopify/app-bridge';
const app = createApp({
apiKey: 'API key from Shopify Partner Dashboard',
shopOrigin: getShopOrigin(),
});
```
### Actions
A list of available actions can be found in the [actions source folder](./src/actions).
## Contributing
### Useful scripts
- `yarn start` Start a development server
- `yarn build` Build the library, compiling the source TypeScript into JavaScript
- `yarn clean` Remove any artefacts produced by the `build` script
- `yarn lint` Run the source linter
- `yarn check` Run the TypeScript type checker
### Running the tests
- `yarn test` Run the tests
- `yarn test:watch` Run the tests in watch mode and auto-rerun on changes
- `yarn test:coverage` Run the tests and generate a coverage report
### Prettier config
To enable automatic prettier formatting copy or link the pre-commit script to
`.git/hooks/pre-commit` and make sure it's executable.