Migrate your app from Shopify App Bridge 1.x to Shopify App Bridge 2.0
Migrating from Shopify App Bridge 1.x to App Bridge 2.0 makes sure that your app is performant, flexible, and has the latest features. App Bridge 2.0 includes a more streamlined interface for actions and an improved architecture for tree-shaking.
RequirementsAnchor link to section titled "Requirements"
- Your app needs to currently be running on App Bridge 1.x.
Modify your app to use the Anchor link to section titled "Modify your app to use the host parameter"
A new query parameter named
host has been introduced with the release of App Bridge 2.0. The base64-encoded
host parameter represents the domain that is currently hosting your embedded app.
In the Shopify adminAnchor link to section titled "In the Shopify admin"
The Shopify admin provides the
host parameter as part of the app URL when loading your embedded app:
After the OAuth flowAnchor link to section titled "After the OAuth flow"
host query parameter is also available to the app as part of the
GET request made to the allow-listed redirect URL specified.
You need to store the
host parameter for use with the updated
Modify your app to use the Anchor link to section titled "Modify your app to use the Action enum instead of ActionType"
Action enum instead of
To streamline the library and simplify the interface, the
ActionType enum has been removed from App Bridge actions. The
Action enum is now used exclusively. If you need to change your code for this update, then it will be on action subscriptions:
Remove any helpers and types previously marked Anchor link to section titled "Remove any helpers and types previously marked deprecated"
The following helpers and type definitions have been marked as deprecated in App Bridge 1.0. In App Bridge 2.0, they are fully removed:
If your code imports and uses any of the helper methods or type definitions above, then you should create your own versions.