It looks like you’re facing two issues with your Shopify public app:
Redirection issue when using the host from URL parameters**
When using a static host, redirection works fine.
When fetching the host dynamically from URL parameters, it doesn’t redirect, and you get an onrlp is undefined" error.
App Bridge is not generating a session token
Do you have a specific error?
Are you using the latest version of App Bridge?
yes i use latest version 2.0.
App Bridge is no longer versioned and installed via script
tag.
That might be why, please see App Bridge
i would see the app bridge and inplement in react js not in pure js.
Hi, sorry could you explain a bit more please.
You still need to load the script tag in regardless of framework.
There is an additional react wrapper you can use, but you must always load the script tag.
Bro, I’m calling it inside the script tag and wrapping it with a React Fragment wrapper, but it’s not fetching the host params. Instead, it’s directly redirecting. And until the host params are fetched, the session token won’t be generated.
You shouldn’t wrap it in a React Fragment. The script tag should be loaded in your index.html if you are using pure react.
It must be the first script loaded before you app, as the documentation states App Bridge
You do not need to do anything with the host params with the new app bridge.
You can then use the library for react components and hooks App Bridge
Session tokens will automatically be injected for you in API calls using fetch for example, so again you shouldn’t really need to do anything here.
I am creating a new public app on Shopify Admin, but after completing all the steps, the last step is not getting completed.
I have followed the step-by-step procedure, but it is still not working.
Can you please elaborate on how to complete this?
Have you logged into your app and interacted with it? And has it been 2hrs since that?
Is your API authenticating using session tokens?
Bro, the login is working in the app and the GET route is also working, but when I log in, the token is not getting authenticated.