Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Integrating Shopify App Bridge with OAuth Flow

Integrating Shopify App Bridge with OAuth Flow

plutonian
Visitor
2 0 1

Hi there,

I am developing an embedded app and am generally pretty confused about how to integrate the Shopify App Bridge React provider component (https://shopify.dev/tools/app-bridge/react-components/provider) with the OAuth flow. Should the App Bridge provider component only be initialised once the embedded app has been installed?

I am currently facing an issue if I wrap my App component with the App Bridge provider using the option:

forceRedirect: true

 When I test installation on a dev store using "Test your app"  in my Shopify Partner dashboard, then it will always redirect to: https://<store-name>.myshopify.com/admin/apps/<api-key> which does not exist yet if the user has not installed the app...

This leads me to think that the Shopify App Bridge provider should be used conditionally (only after the app has been installed for a store). However this seems a little clunky and I haven't before seen this pattern of conditionally applying provider components in React apps. Am I on the right track or way off?

Cheers!

Reply 1 (1)

traian1
Shopify Partner
1 0 0

I am facing the exact same issue - I feel like I am missing something in the way I setup my app OAuth flow and like Plutonian has mentioned, conditionally using the App Bridge Provider seems a bit clunky...