Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

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

bovojon
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)