Studio v5 to v6
Upgrading to v6 requires Node.js 22.12, turns on React strict mode in development, and changes the auth provider and search defaults.
Sanity Studio v6 raises the minimum Node.js version to 22.12, turns on React strict mode in development, and changes two defaults: how custom auth providers combine with the built-in ones, and which search strategy the Studio uses. Your schemas, plugins, configuration shape, and content APIs are unchanged.
If your Studio already runs on Node.js 22.12 or later, runs cleanly under React strict mode, and does not customize auth.providers, this is a one-line upgrade. Otherwise, work through the sections here in order.
Prerequisites
- A Studio running Sanity v5. If you are on v4, follow Studio v4 to v5 first, then return here.
- React 19.2.2 or later, which v5 already requires.
Upgrade Node.js to 22.12
Node.js 20 reached end of life, so v6 drops support for it. The minimum is now Node.js 22.12, which matches the Sanity CLI. This affects you only if you build or deploy your Studio yourself; Studios deployed with sanity deploy are already built on a supported runtime.
Check your installed version:
node --versionIf you pin a Node.js version in your package.json, raise it to match. An older value produces an error or a warning when you install v6.
{
"engines": {
"node": ">=22.12"
}
}Install Sanity v6
Install the v6 release with your package manager of choice:
npm install sanity@^6pnpm add sanity@^6Sanity Studio v6 requires @sanity/cli v7 or later, which the sanity package brings with it. If you also list @sanity/cli as a direct dependency, upgrade it at the same time.
Test under React strict mode
React strict mode is on by default in development in v6. Strict mode runs effects and renders twice, which surfaces effect-cleanup and concurrent-rendering bugs in custom inputs, components, and plugins. It reveals existing problems rather than creating new ones, and it has no effect on production builds.
Run your Studio in development and resolve anything strict mode reports:
npx sanity devpnpm dlx sanity dev
yarn dlx sanity dev
bunx sanity devTo turn it off, set reactStrictMode to false:
import {defineCliConfig} from 'sanity/cli'
export default defineCliConfig({
api: {
projectId: 'YOUR_PROJECT_ID',
dataset: 'YOUR_DATASET',
},
reactStrictMode: false,
})Update custom auth providers
This section applies only if you set auth.providers in your Studio configuration.
In v6, a static auth.providers array replaces the built-in providers instead of adding to them, and the auth.mode option is removed. To keep appending to the defaults, pass a function instead of an array.
Replace the v5 form:
export default defineConfig({
// ...
auth: {
mode: 'append',
providers: [
{
name: 'sanity',
title: 'Email / Password',
url: 'https://api.sanity.io/v1/auth/login/sanity',
},
],
},
})With the v6 form:
export default defineConfig({
// ...
auth: {
providers: (prev) => [
...prev,
{
name: 'sanity',
title: 'Email / Password',
url: 'https://api.sanity.io/v1/auth/login/sanity',
},
],
},
})If you were already using mode: 'replace', remove the mode line and keep your array. Replacing is now the default behavior.
Review search behavior
The default search strategy is now groq2024, replacing groqLegacy. It performs better on large datasets, reaches deeper into nested content and full Portable Text, and supports wildcards, phrases, and negation.
The two strategies use different query logic, so search results, their ordering, and result counts can shift. For most Studios this is an improvement that needs no action. To keep the previous behavior, set the strategy back:
export default defineConfig({
// ...
search: {
strategy: 'groqLegacy',
},
})The deprecated enableLegacySearch option is removed in v6. If you set it, replace it with search.strategy.
Check custom Vite configuration
The Studio build moves to Vite 8, which bundles with Rolldown. Sanity measured build times between 2 and 9 times faster in internal testing, with smaller bundles from better tree shaking. The React plugin updates on its own.
If you customize the build through the vite option in sanity.cli.ts, follow the Vite 8 migration guide. The most common change is renaming build.rollupOptions to build.rolldownOptions. Some other Rollup-specific options change behavior or stop having an effect.
Run a production build to confirm your configuration still works:
npx sanity buildpnpm dlx sanity build
yarn dlx sanity build
bunx sanity buildNext steps
v6 is the current major version. To keep your Studio current from here, see Upgrading Sanity Studio and Understanding the latest version of Sanity.