App Providercomponent
Sets up your app to look like the admin
Adds Polaris Web components to the route. If embedded is true and apiKey is provided, then the App Bridge script will be added to the page.
Anchor to appproviderpropsAppProviderProps
Props for the component.
EmbeddedProps
The API key for your Shopify app. This is the from the Partner Dashboard.
When using the Shopify CLI, this is the environment variable. If you're using the environment variable, then you need to pass it from the loader to the component.
If this route should be rendered inside the Shopify admin.
Setting this to true will include the App Bridge script on the page. If true and the route is loaded outside the Shopify admin, then the user will be redirected to the Shopify admin.
Setting this to false will not include the App Bridge script on the page.
NonEmbeddedProps
If this route should be rendered inside the Shopify admin.
Setting this to false means only Polaris Web components will be added to the route, not App Bridge.
Setting this to true will include the App Bridge script on the page.
Anchor to examplesExamples
Anchor to example-set-up-appprovider-for-an-embedded-routeSet up AppProvider for an embedded route
Wrap your route in the component and pass in your API key.
Anchor to example-set-up-appprovider-for-a-non-embedded-routeSet up AppProvider for a non-embedded route
Add Polaris web components to the route, without adding the App Bridge script.