CORS POLICY ERROR for 'X-Shopify-Access-Token'

Hi Mohdyou,

Even if your application is mostly client-side, for tasks that involve calling APIs, you should have a server-side component to your app that securely stores your credentials and makes requests to the Shopify API. The frontend of your application can then make requests to your own backend, which in turn calls the Shopify API and returns the response back to your frontend. This way, the actual call to Shopify’s API is made server-side, avoiding CORS issues and keeping your credentials secure.

Since you do not have any backend, you might want to consider using serverless functions (like Vercel or Netlify functions) to handle these kinds of tasks.

Hope this helps!

1 Like