Questions and discussions about using the Shopify CLI and Shopify-built libraries.
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!
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...