Unlock seamless workflows and faster delivery with our latest releases – get the details

Workspaces

Learn about working with multiple workspaces within a single studio setup

Sanity Studio can accommodate multiple workspaces, each with its very own configuration. To set up a studio with more than one workspace, simply supply an array of configurations to defineConfig instead of a single config object.

// Multiple workspace configuration
import {defineConfig} from 'sanity'
import {RobotIcon, RocketIcon} from '@sanity/icons'
import {structureTool} from 'sanity/structure'
import {schemaTypes} from './schemas'

export default defineConfig([
  {
    projectId: '<projectId>',
    dataset: 'production',
    name: 'production-workspace',
    basePath: '/production',
    title: 'Default Workspace',
    subtitle: 'production',
    icon: RobotIcon,
    plugins: [structureTool()],
    schema: {
      types: schemaTypes,
    },
  },
  {
    projectId: '<projectId>',
    dataset: 'staging',
    name: 'staging-workspace',
    basePath: '/staging',
    title: 'Another Workspace!',
    subtitle: 'staging',
    icon: RocketIcon,
    plugins: [structureTool()],
    schema: {
      types: schemaTypes,
    },
  },
])

The studio will pick up your new workspace and display a dropdown next to the studio title in the navbar to let you quickly switch between workspaces.

Workspace configuration properties

Studio configurations and workspace configurations are the same thing. We refer to them as studio configs when there's only one configuration, and as workspace configs when there are multiple configurations.

In practice, all configuration properties are workspace configuration properties. There are a few properties that, while legal and valid also for single workspaces, don't have actual value outside the context of a multi-workspace setup. For more information, see this reference article.

Was this article helpful?