Passing access token to unauth users?

52 3 10



On this page I see an example of how to pass a token to admin users after they are authenticated:


However the Storefront API requires passing tokens to ALL users including unauthenticated ones. Can anyone show an example of how to obtain and pass a token to them?


PS: I understand the general concept but a Express or Koa code example would add a lot of clarity.

Reply 1 (1)

Shopify Staff (Retired)
624 104 188

Hi @seandz ,


First and foremost, you would have to create the Storefront Access Token by sending a POST request to the endpoint of "/admin/api/2019-10/storefront_access_tokens.json" using the token for authenticated admin users (read more about this here:


After this is done, you will get the Storefront Access Token for your Shopify store. So now whenever you are sending a request to the Storefront API for your customers from your custom storefront (i.e. the Javascript on your custom store website or the mobile application for your store), all you need to do is pass this storefront access token through the "X-Shopify-Storefront-Access-Token" header and your request should work. 


In terms of examples of how to work with the Storefront API with various open-source frameworks (i.e. Express, Ember, etc.), you can look into this Github repository here: As well, you can also look into using the JS-Buy-SDK (here: which is a Shopify Javascript SDK library built on top of the Storefront API. 


To learn more visit the Shopify Help Center or the Community Blog.