App reviews, troubleshooting, and recommendations
import createApp from "@shopify/app-bridge"; import { getSessionToken } from "@shopify/app-bridge/utilities"; const app = createApp({ apiKey: "12345", }); const sessionToken = await getSessionToken(app);
How can i get this session token in App Bridge React v4?
I'm having the same issue too after upgrading to v4 just to get the Modal working.
Hello,
@Shopify/app-bridge/utilities package is deprecated https://www.npmjs.com/package/@shopify/app-bridge-utils
Instead of using this, You find everything on app state https://www.npmjs.com/package/@shopify/app-bridge
Once the app is set up, you can access additional details and the state of the app at any time by making async call app.getState():
app.getState().then((state) => { console.info('App State:', state); });
Okay, so I can't install shopify/app-bridge and shopify/app-bridge-react without shopify/app-bridge-utils.
Here's what I have in my package.json.
Now I am getting a Module Not Found error:
I got it wrong. There's no @Shopify/app-bridge v4, that's for app-bridge-react.
in app bridge react 4 with the app bridge JS tag added to your index.html you don't need that session token since all fetch calls are wrapped and add that token automatically however if you still need it you can use this :
https://shopify.dev/docs/api/app-bridge-library/apis/id-token
where shopify is the variable u get this way :
const shopify = useAppBridge()
Thankyou , it helps me to resolve my issue but can you help me with
$response->getBody {"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}
i got $request->all() []
did you ever get this resolved? I'm having the same issue with the remix app template?
const shopify = useAppBridge();
await shopify.idToken() -> gives me an auth token
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025