Questions and discussions about using the Shopify CLI and Shopify-built libraries.
Hi there, after reading this article (https://www.shopify.com/partners/blog/embedded-apps) about using session tokens to make our app load faster and more reliably, we decided to implement this in a new embedded test app before we roll it out to our other apps. However, the tutorial (https://shopify.dev/tutorials/authenticate-your-app-using-session-tokens?itcat=partner_blog&itterm=e...) seems to be a little convoluted and I'm having a tough time following the instructions.
The app is a Node.js app created via the shopify-cli. As such, I am working with the autogenerated code in the _app.js file, which uses <Provider> from "@shopify/app-bridge-react" rather than the traditional createApp from "@shopify/app-bridge"
Given that the ApolloClient is declared here, how should I perform authenticatedFetch for the app here? I've tried declaring `const app = useAppBridge()` outside of the MyApp class, but it seems to be a React hook which only works inside a functional component.
I appreciate any advice that anybody can offer to help me proceed with this. Should I be rewriting the MyApp class into a functional component? Or anything else? Thank you in advanced.
I'm also having quite a bit of trouble with the Backend changes section of the tutorial; is there any place I can find further guidance on what to do with that? I don't have much experience with these kinds of stuff just yet but I'm trying to learn and do what I can.
I've tried a number of things, like trying to change MyApp from a class-based component into a functional component, using app-bridge rather than app-bridge-react to be able to use createApp, among other things, but I don't feel like I've made much progress with this. So again, any help is greatly appreciated!
I am trying to implement the same! But still no luck.
Were you able to figure out a way?
Unfortunately, I haven't made much progress on this either. I've put this off in the meantime until I find time to try and get a thorough understanding of this, though I'm still hoping someone can give some clearer advice.
Hi,
I am interested in an examle as well, i.e. for a frontend using
same here... any progress?