Hi, when I’m trying to add my app block (checkout ui extension) on the thank you page in the checkout editor, the app is supposed to show in the preview, but it doesn’t because the session token isn’t working (the app fetches data from my backend using this token). I get this error: SessionTokenNotFoundError: no session token in data.
const { sessionToken } = useApi("purchase.thank-you.block.render");
const token = await sessionToken.get()
If I just save and refresh the page, the session token works and everything functions correctly. This only happens during the initial render when I add the block. Also, the error only appears on a real pay store, not on a development store.
When I test adding the block with the browser console open in network, I see a grapql request “graphql?operationName=CheckoutExtensionSessionToken” with an app id and an extensionActivationId. Here we see that the request returns nothing, whereas in the development store there’s a token in return, with a real pay shop if you save and update, it works fine also there is a token. It’s only when the block is first added.
Network access / API access are correctly allowed.
Do you have any ideas ? Thank you.