Skip to content

App Bridge React 4: remove <Provider>; configure via app-bridge.js + <meta name="shopify-api-key"> #11

@codemod-com-bot

Description

@codemod-com-bot

Area

app-bridge-react

Why this matters

Why: v4 removes the React Provider; configuration moves to a script tag + meta api key. This is often the first blocker when upgrading. (Shopify)

Before (code/config)

import {Provider} from '@shopify/app-bridge-react';

<Provider config={config}>
  <App/>
</Provider>

After (code/config)

<head>
  <meta name="shopify-api-key" content="%SHOPIFY_API_KEY%" />
  <script src="https://cdn.shopify.com/shopifycloud/app-bridge.js"></script>
</head>
// No Provider needed in v4
<App/>

Detection strategy

  • Any import of Provider from @shopify/app-bridge-react or JSX usage of <Provider ...>.
  • Missing app-bridge.js + shopify-api-key in HTML/template.

Edge cases & caveats

  • Multi-entry apps may need the script/meta in every HTML shell.
  • Server-rendered shells must ensure the meta tag is present.

Authoritative reference URL

https://shopify.dev/docs/api/app-bridge/migration-guide#step-1-add-the-app-bridgejs-script-tag and https://shopify.dev/docs/api/app-bridge/migration-guide#step-3-remove-the-provider-setup (Shopify)

Metadata

Metadata

Assignees

No one assigned

    Labels

    app-bridge-reactApp Bridge React transformationsbreaking-changeBreaking change requiring migration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions