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 {deskTool} from 'sanity/desk'
import {schemaTypes} from './schemas'

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

Technically (and confusingly) studio configurations and workspace configurations are for all intents and purposes the same thing. We just tend to refer to them as studio configs when there's only one of them, and workspace configs once there's two or more.

This means that ALL configuration properties are, by definition, workspace configuration properties. That said, there's a few properties that, while legal and valid for single workspaces, don't really make a lot of sense to talk about outside of a multi-workspace setup. You can read more about these in this reference article.

Was this article helpful?