--- title: Migrate your app from Shopify App Bridge 1.x to Shopify App Bridge 2.0 description: >- Migrate your application from Shopify App Bridge 1.x to Shopify App Bridge 2.0. api_name: app-bridge source_url: html: 'https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2' md: 'https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md' --- ExpandOn this page * [Requirements](https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md#requirements) * [Modify your app to use the host parameter](https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md#modify-your-app-to-use-the-host-parameter) * [Modify your app to use the Action enum instead of Action​Type](https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md#modify-your-app-to-use-the-action-enum-instead-of-actiontype) * [Remove any helpers and types previously marked deprecated](https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md#remove-any-helpers-and-types-previously-marked-deprecated) * [Next steps](https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md#next-steps) # 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. *** ## Requirements * Your app needs to currently be running on App Bridge 1.x. *** ## 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 admin The Shopify admin provides the `host` parameter as part of the app URL when loading your embedded app: ```text https://example.org/?hmac={hmac}&host={base64_encoded_hostname}&session={session}&shop={shop_origin}×tamp=1409617544 ``` ### After the OAuth flow The `host` query parameter is also available to the app as part of the `GET` request made to the allow-listed redirect URL specified. ```text https://example.org/some/redirect/uri?code={authorization_code}&hmac=da9d83c171400a41f8db91a950508985&host={base64_encoded_hostname}&shop={shop_origin}&state={nonce}×tamp=1409617544 ``` You need to store the `host` parameter for use with the updated `createApp` method: ```js const app = createApp({ apiKey: apiKey, host: host }); ``` *** ## Modify your app to use the `Action` enum instead of `ActionType` 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: ### Examples ```js // Right app.subscribe(Error.Action.INVALID_ACTION, (data) => {}); app.subscribe(Loading.Action.START, () => {}); app.subscribe(History.Action.REPLACE, (payload: History.Payload) => {}); // Wrong app.subscribe(Error.ActionType.INVALID_ACTION, (data) => {}); app.subscribe(Loading.ActionType.START, () => {}); app.subscribe(History.ActionType.REPLACE, (payload: History.Payload) => {}); ``` *** ## 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: * `HandlerData` type definition * `getShopOrigin` helper method * `getUrlParams` helper method If your code imports and uses any of the helper methods or type definitions above, then you should create your own versions. *** ## Next steps * [Getting started with Shopify App Bridge](https://shopify.dev/docs/api/app-bridge/previous-versions/app-bridge-from-npm/app-setup). *** * [Requirements](https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md#requirements) * [Modify your app to use the host parameter](https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md#modify-your-app-to-use-the-host-parameter) * [Modify your app to use the Action enum instead of Action​Type](https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md#modify-your-app-to-use-the-action-enum-instead-of-actiontype) * [Remove any helpers and types previously marked deprecated](https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md#remove-any-helpers-and-types-previously-marked-deprecated) * [Next steps](https://shopify.dev/docs/api/app-bridge/previous-versions/migrating-to-2.md#next-steps)