All questions

Saw the dev.to post on the Sanity integration, does it fit an embedded Studio setup?

Asked by ninap on

Nninap

came across the dev.to article on the Sanity integration for A/B testing and personalization and it looks like what I need for my saas landing pages.

One thing the article does not cover: I run Sanity Studio embedded inside my Next.js app (the /studio route) rather than as a separate deployment. Does that change anything about the setup, or does the integration not care where Studio lives? Did not want to burn an evening finding out the hard way

Was this helpful?

2 answers

FAFelipe Arruda

It should not matter. The integration works on the frontend side of your stack: you map your Sanity components to Croct slots in the rendering code, and the content you author in Studio stays the default fallback. Studio itself is not part of that loop, so whether it is embedded at /studio or deployed separately changes nothing about the model.

The only thing I would keep an eye on is your route setup, so the slot fetches only happen on your public pages and not inside the Studio route. That is ordinary Next.js routing though, nothing integration-specific.

Was this helpful?
Nninap

Tested it tonight and confirming Felipe's answer. Ran npx croct@latest init in the same Next.js project that embeds Studio, mapped my hero component to a slot, and everything worked first try. The embedded /studio route is untouched, the personalization layer only touches the pages where I fetch slot content.

So for anyone else with an embedded Studio: no special steps, the setup from the article applies as-is.

Was this helpful?
Still have questions?