Sanity Studio v6: A focused upgrade

Written by Cody Olsen, Bjørge Næss, Jordan Lawrence, John Siciliano

Missing Image!

We're releasing v6 of the sanity package this week, bringing Vite 8 to the Studio's development tooling.

The Vite upgrade brings great improvements for builds. Across the studios we've measured, median build times droped around 4.8×. You also get smaller bundles from improved tree shaking and a faster, more capable default search. Good stuff!

And with Node.js 20 past end of life since April, no longer receiving security patches, we're dropping support for it.

The surface you work with is unchanged: schemas, configuration, and content APIs all stay the same. If you use the Studio, but don't maintain one, there's nothing for you to do.

The pre-release is out now via, so you can test the upgrade ahead of time:

npm install sanity@next

We’re publishing v6 peer dependency support for official plugins now, and v6 of the sanity package gets the latest tag on Thursday, June 11:

npm install sanity@latest

Read on for full upgrade notes.

What's changing

In case you missed it (or if you still are on v4); v5 brought 20–30% faster editing (React Compiler), an incoming references inspector (finally!), much better TypeGen, smart typography on by default in the Portable Text Editor, and a stack of editor quality-of-life additions.

We’re shipping v6 with improvements too, and of course, more to come.

React strict mode is on by default in development.

Strict mode has always been available via reactStrictMode in sanity.cli, but the default is now true.

Custom auth providers no longer support the mode option

Previously, configuring an array of custom auth providers via auth.providers in sanity.config.ts would append them to the default providers. To replace the built-in providers with your own, you'd set mode: 'replace'.

But the most common reason for adding custom auth is to replace the default providers. So it made sense to change it.

As of v6, auth.providers replaces by default, and mode: 'append' is no longer supported. To keep the previous behavior, use the callback config instead:

auth: {
  providers: (prev) => [
    ...prev,
    {
      name: 'sanity',
      title: 'Email / Password',
      url: 'https://api.sanity.io/v1/auth/login/sanity',
    },
  ],
},

Faaaaaster builds on Vite 8

Studio v6 upgrades the build to Vite 8, a significant performance win. Across the studios we've measured, build times dropped 2–9×, with a median around 4.8×. Builds that took 10 to 15 seconds on v5 typically land in 1 to 4 seconds on v6. Expansive studios should see comparable gains.

Big kudos to the Vite team for bringing these improvements to the ecosystem!

Improved default search strategy

We changed the default from groqLegacy to groq2024 (which year is this?) as the default. You get faster search on large datasets, full Portable Text search with deeply nested content coverage, and Google-style queries (wildcards, phrases, negation). This strategy has been production-proven since early 2025.

search: {
  strategy: 'groqLegacy',
}

Node.js 20 is dead, so we don’t support it

With Node.js 20 at end of life and not receiving security patches anymore, the minimum supported version is now Node.js 22.12, in line with the Sanity CLI.

This only matters for the environments where you run the Studio dev server or build the Studio, so your local machine and your CI or build pipeline. It does not affect a deployed Studio. The Studio builds to static assets (HTML, CSS, JS) that run in the browser, so there is no production server that needs Node or that you need to upgrade.

To resolve, upgrade your local and CI/build environments to Node.js 22.12 or newer, and set engines.node to >=22.12.

What this means for you

If you're a Sanity Studio user

Once the Studio is updated, you will get the improvements to search, hopefully fewer bugs, and less confusing custom auth experience. The developers maintaining your studio will handle the update.

If you're maintaining a studio

After v6 ships on Thursday, June 11, if your studio runs or builds on Node.js 22.12 or newer, runs cleanly under strict mode, and has no custom auth.providers, the upgrade is a version bump:

npm install sanity@latest

Otherwise, run sanity dev against the pre-release and work through the changes that apply before bumping.

In either case, if a plugin you depend on hasn't published a v6-compatible peer range yet, npm will fail the install on peer resolution. Run the command below to allow legacy peer dependencies as a stopgap until the plugin(s) catches up:

npm install sanity@latest --legacy-peer-deps

If you're a Sanity Studio plugin developer

Test against the pre-release and update your peerDependencies to include v6:

{
  "peerDependencies": {
    "sanity": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0-0"
  }
}

Until you publish that range, studios upgrading to v6 that depend on your plugin will hit an npm peer-dependency error, so publish as soon as you've verified against the pre-release.

You can follow our progress toward v6 being available on latest, including plugin migration and Node 20 support, at Are We V6 Ready.

Pre-release and upgrade path

The pre-release is available under a custom distribution tag on the next branch. The main branch continues to ship v5 through latest, and stable unchanged. To try v6 ahead of promotion to latest:

npm install sanity@next

Promotion to latest happens on Thursday, June 11.

PortableText [components.type] is missing "callout"

Questions? Find us in the Sanity Community Discord or check the changelog when v6 ships.