Upgrading Sanity Studio
How to upgrade Sanity Studio
Sanity Studio is distributed as a npm package, which means that upgrades are done as with any other dependency in package.json
.
The simplest way to upgrade the core package for Sanity Studio is:
npm install sanity@latest
## alternative package managers
yarn upgrade sanity@latest
pnpm install sanity@latest
Make sure that your lock file (for example, package-lock.json
) has been updated as well.
As with the core sanity
dependency, plugins, and other dependencies are also upgraded by installing newer versions. You can also look into tooling like npm-upgrade and npm-check-updates that give you interactive CLI workflows for upgrading your dependencies. Code editors like VS Code also have plugins with UI affordances for managing and updating dependencies.
After you have upgraded your Studio project's dependencies, you can deploy the new version depending on your deployment strategy:
- Run the
sanity deploy
command in your command line. - Or, check the changes into git and push/merge to the branch that deploys the Studio to production.
We advise you to always check and track your studio code into git and push it to a remote git repository. That way, you won't accidentally lose your work.
If you deploy Sanity Studio from GitHub (or other compatible platforms), then you can automate upgrades by setting up Renovatebot. We maintain the preset configuration for Sanity projects that you can reuse.
Go to the Sanity config presets on GitHub and follow the instructions to set it up.
We publish updates to Sanity Studio up to every week. For each release of the Studio, we'll also post release notes on GitHub and in our changelog (that also covers other packages and APIs).
Changelog entries on sanity.io will also mark any documentation article that was affected by the upgrade. You will find related changelog entries by expanding the changelog menu above the documentation article.
You will find migration instructions in the changelog entry on the rare occasions where there have been breaking changes.