
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeAbsolutely! Setting up staging and production environments for your Sanity Studio is definitely possible, and it's a smart approach when you're making schema and UI changes. Here's how to do it:
The key is to use separate datasets for staging and production. Datasets are completely isolated collections of content within your Sanity project - think of them as separate databases. Your Free plan includes 2 datasets, which is perfect for this setup.
1. Create a staging dataset
If you don't already have one, create a staging dataset using the Sanity CLI:
sanity dataset create staging2. Configure environment variables
Since you're deploying to Vercel, you'll want to use environment variables to control which dataset each deployment uses. The key variable is SANITY_STUDIO_API_DATASET.
In your Studio project, you can create environment-specific files:
.env.development (for local work).env.production (for production builds)For example, in .env.development:
SANITY_STUDIO_API_DATASET="staging"
3. Set up Vercel deployments
The recommended approach is to deploy separate Studio instances to Vercel:
SANITY_STUDIO_API_DATASET set to productionstaging) and deploy it to Vercel with SANITY_STUDIO_API_DATASET set to stagingThis way, you can test schema and UI changes in your staging Studio without affecting production.
Important note: If you're using Sanity's hosted Studio (xxx.sanity.studio), you can only host one version there. For staging, you'll need to host on Vercel or another platform. Many teams host production on Sanity's hosting and staging on Vercel, or both on Vercel.
Don't forget to add your Vercel deployment URLs to your CORS origins in the Sanity management dashboard (manage.sanity.io):
https://studio-staging.vercel.app)https://*.vercel.app (though be cautious with wildcards in production)Make sure to check "Allow credentials" if you're using authentication tokens.
If you only need to switch between datasets but don't need different UI/schema versions, you could use Workspaces to configure multiple isolated Studio configurations within a single deployment. Each workspace can connect to a different dataset and have its own tools and plugins. However, this won't help with testing breaking schema changes since all workspaces share the same codebase - both datasets would use the same Studio code version.
For your use case where you're actively changing the schema and UI, separate deployments (as described above) are the better approach.
When you're ready to deploy Studio changes:
sanity deploy (if using Sanity hosting) or merge to your production branch (if using Vercel)This setup gives you a safe environment to test changes before your client sees them in production!
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store