Shopify App Bridge provides two methods that are used to initialize your app instance.
Using ES5 and the CDN-hosted version:
app object. Used to initialize your application.
The config hash can contain the following keys:
apiKey(string) The API key provided for your application in the Partners Dashboard.
shopOrigin(string) The origin/domain of the Shopify shop. This should be stored in the session; it is returned from the Shopify API and should be set dynamically for each different merchant/shop. The format is similar to "example.myshopify.com".
app object methods
Dispatches an action to Shopify App Bridge. Hosts (like admin) can subscribe to actions to listen for these dispatches.
action(Action) One of Shopify App Bridge’s included actions.
Subscribe to all errors, including those that are caused by actions. Returns a method you can use to unsubscribe from all errors.
callback(function) The function you want to execute when an error occurs.
Returns a Promise which, when resolved, returns information about your app’s current state, including the currently logged in staff member.
app.subscribe(callback, id?) and
app.subscribe(eventNameSpace, callback, id?)
Subscribe to actions. When no
id are provided, this method subscribes to all actions. Returns a method you can use to unsubscribe.
eventNameSpace(string) (optional) Include this to subscribe only to actions of a particular type (for example,
callback(function) The function you want to execute when an action is dispatched.
idof a particular action instance to subscribe to.