
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeBased on the SEO context mentioning Shopify post-purchase extensions and upsell functionality, it sounds like you're building a Shopify app or extension that needs to fetch data from Sanity, and you're hitting CORS restrictions.
The issue is that Shopify's post-purchase extensions and checkout UI extensions run in a sandboxed environment with strict network access policies. When these extensions try to fetch data from Sanity's API, the browser blocks the request because your domain isn't configured in Sanity's CORS Origins settings.
Here's how to fix it:
For Shopify extensions, you'll typically need to add:
https://cdn.shopify.com (for checkout and post-purchase extensions)https://yourstore.myshopify.com)Important: Make sure to check the "Allow credentials" checkbox if you're using authentication tokens with your Sanity client.
Asset CDN: If you're fetching assets (images, files) directly from Sanity's CDN, note that CORS settings in the Management Dashboard only apply to the Data API, not the Asset CDN. Most image requests work without additional CORS configuration, but if you're fetching specific file types like GeoJSON, you might encounter separate restrictions.
Shopify Network Access: Shopify's post-purchase and checkout UI extensions have limited network access. They can only make fetch requests to:
If you continue having issues after configuring CORS, you might need to proxy requests through your Shopify app backend rather than calling Sanity's API directly from the extension. Alternatively, consider using Sanity Functions as a serverless backend that can handle these requests with proper CORS configuration and act as an intermediary between your Shopify extension and Sanity's Content Lake.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store