Unlock seamless workflows and faster delivery with our latest releases- get the details

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?
Feb 6, 2023, 4:13 PM
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?
Feb 6, 2023, 8:58 PM
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?
Feb 6, 2023, 9:06 PM
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?
Feb 6, 2023, 9:12 PM
Looks to be the privacy settings. Thanks Knut for the help!
Feb 6, 2023, 9:44 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?