
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeBased on the error message you're seeing, the issue is specifically with the credentials configuration. The error states that Access-Control-Allow-Credentials must be 'true' when credentials mode is 'include', which indicates you need to enable the "Allow credentials" option in your CORS settings.
Here's how to fix this:
https://my-domain) in the listThis checkbox is crucial when using authentication tokens with @sanity/client. According to the Sanity CORS documentation, the "Allow credentials" setting must be enabled for any origin that needs to send authenticated requests.
The @sanity/client library sends requests with credentials when you're using authentication tokens. This causes the browser to set the request's credentials mode to 'include', which requires the server to respond with Access-Control-Allow-Credentials: true. Without the checkbox enabled in your CORS settings, Sanity's API won't send this header, causing the browser to block the request.
https:// vs http://)http://localhost:3000) with credentials enabledAfter enabling the "Allow credentials" checkbox, your requests should work properly. The change should take effect immediately without needing to restart your application.
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