How to update "Open Sanity Studio" URL for embedded Next.js studio
To update the URL that the "Open Sanity Studio" button points to, you need to configure the canonical studio URL in your project management settings. Here's how to do it:
Update Your Studio URL in Sanity Manage
- Navigate to manage.sanity.io and select your project
- Go to the Studios tab
- Add or update your studio URL to point to your embedded Next.js app (e.g.,
https://yourdomain.com/adminor wherever your studio is embedded)
This is the canonical studio URL that Sanity uses for the "Open Sanity Studio" button throughout the platform, including in the Dashboard and project management interface.
Additional Setup for Embedded Studios
Since you've embedded the studio in your Next.js app, you'll also need to make sure your studio is properly configured to work with the Dashboard:
1. Generate and deploy your schema:
npx sanity manifest extract --path public/studio/static
npx sanity schema deployThe --path should correspond to where your studio lives relative to your Next.js project root.
2. Add the Dashboard bridge script to your studio route:
import {preloadModule} from 'react-dom'
const bridgeScript = 'https://core.sanity-cdn.com/bridge.js'
export default function StudioLayout({
children,
}: {
children: React.ReactNode
}) {
preloadModule(bridgeScript, {as: 'script'})
return (
<>
<script src={bridgeScript} async type="module" />
{children}
</>
)
}This bridge script allows the Dashboard to properly interact with your embedded studio.
3. Ensure your studio is publicly accessible without authentication so Dashboard can embed it properly.
Once you've set the studio URL in manage.sanity.io and deployed these changes, the "Open Sanity Studio" button will point to your custom embedded studio URL instead of the default sanity.studio domain.
For more details, check out the Dashboard configuration documentation.
Show original thread12 replies
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.