Initialization

Once you’ve added the Embedded App SDK to your app, you need to initialize it by passing in your API key and the shop name.

ShopifyApp.init({
  apiKey: 'API key from Shopify Partner Dashboard',
  shopOrigin: shopOrigin,
});

The script detects if your app was loaded inside an iframe. If not, it will create a redirection back into the relative embedded URL in the Shopify admin. This functionality can be disabled by passing forceRedirect: false as a configuration option.

Set up the Shopify title bar

On every page of your app, you should define the behavior of the Shopify title bar in relation to your application. The following example script updates the title bar.

var breadcrumb = {
  label: 'My breadcrumb',
  href: '/breadcrumb-link',
  target: 'app',
}

var titleBarOptions = {
  title: 'My page title',
  breadcrumb: breadcrumb,
}

ShopifyApp.ready(function() {
  ShopifyApp.Bar.initialize(titleBarOptions);
});

Methods

After you've initialized your app, you can use any EASDK methods. To learn more about the supported methods, see Methods.

Sign up for a Partner account to get started.

Sign up