How to get storeFrontAccess token in Shopify cli3 to use as a marketplace app?

Shopify Partner
24 0 1

Hi all,


With Shopify CLI 2, I used the following graphql client to get a new storefront token:

const client = new Shopify.Clients.Graphql(shop, accessToken)
Then with this client, I could call the `storefrontAccessTokenCreate` mutation which worked fine.
However, since they deprecated the old version, now I need to use this client:
const client = new shopify.api.clients.Graphql({ session });
And then I am doing the same mutation with `storefrontAccessTokenCreate`. But this time, the token it returns does not work when I try to get all products. The new token I get is in a different format and when I try to get the products, it gives an error saying:
{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"
How do we get the storefront access token with the new Shopify Cli 3 API?
Please, would appreciate some help. Been stuck on this.
Replies 0 (0)