Hi
I’m using v6 of shopify-app-js. I’ve created both online and offline tokens and stored them in my db.
I’m trying to create an offline session token for use with the graphql client as I’m accessing an endpoint from outside the app (posting data from the storefront to the app), but I can’t see how to get the offline session token from my db?
This >> https://github.com/Shopify/shopify-api-js/blob/main/docs/guides/session-storage.md says to use
const sessionId = await shopify.session.getCurrentId({
isOnline: true,
rawRequest: req,
rawResponse: res,
});
// use sessionId to retrieve session from app's session storage
// getSessionFromStorage() must be provided by application
const session = await getSessionFromStorage(sessionId);
const restClient = new shopify.clients.Rest({session});
I don’t understand this part
const session = await getSessionFromStorage(sessionId);
I can’t see or find how to use / access getSessionFromStorage. I’ve tried pulling it in myself from the db (didn’t work), but I believe you have to generate the session object somehow, and I’m unsure how?
