App reviews, troubleshooting, and recommendations
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Is there a way to make a direct api request on Theme App Extension? I'm trying to make requests to shopify API on an extension-only app.
I tried to use fetch to call graphql API. It worked on development store, but when I installed the app on a real store it started to throw an cors error.
Hi @Samirjs
The issue you're facing happens because Shopify's API doesn't allow direct requests from the browser due to CORS restrictions (Read more about it here) . This is done for security reasons. Here are some solutions:
Use a Backend Server:
Use Shopify App Proxy:
Unfortunately, direct client-side API calls aren't allowed in live stores as Shopify’s security model blocks such attempts to prevent abuse. Setting up a backend or app proxy will solve the issue 😊
Best regards,
Daisy