Question about configuring production site to request Sanity content.

4 replies
Last updated: Feb 6, 2023
Hi, I really liking the Sanity/Hydrogen integration so far. I am currently working on deploying my first site and have a quick question: What settings need to be changes to let a production site request Sanity content?I have added my store's domain to the CORS settings in Sanity and everything is 100% working locally, but when I deploy, all my requests seem to fail. I can see all my sanity config information and all my environment variables are the same... just no data. Wondering what y'all think I might be overlooking?
Hi Matt, glad that you like the combo!
First, kindly remember that we are more than just “dudes” in this community – we strive for this to be a space where everyone feel that they can belong.
Make sure to familiarize yourself with our Code of Conduct .
Do you get any error messages either on the server(less) side or from network requests in the browser?
Hey Knut, sorry about that. In my area of the country this is a less gender specific term. I've edited my original question to be more inline with the community guidelines.
I am not seeing any sort of error in either the console or the Hydrogen logs. The Sanity request simply returns
null
. Is there somewhere else I could be looking?
Appreciate it – thanks for editing!
Since you’re getting
null
my hunch is that the request goes through, but maybe your dataset is private or something else is going on?
Looks to be the privacy settings. Thanks Knut for the help!

Sanity – Build the way you think, not the way your CMS thinks

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.

Was this answer helpful?