Studio

Configuration API

The Configuration API in Sanity Studio is the primary mechanism that allows you to customize the Studio.

Workspaces

The root configuration of your Studio is created by supplying either a single workspace configuration object or an array of the same type to the defineConfig function, and returning the result as the default export of the configuration file, typically found at the root of your project in a file named sanity.config.js|ts.

// The absolute minimum viable studio configuration
import { defineConfig } from 'sanity'

export default defineConfig({
  projectId: '<project-id>',
  dataset: 'YOUR_DATASET',
})

Properties

The following table shows the most common top-level properties available for configuring and customizing a single workspace studio.

Additional properties for multiple workspace configurations

  • Requiredname

    string

    Name of the workspace, by convention in lowercase/camelCase

  • RequiredbasePath

    string

    URL base path to use, for instance /myWorkspace

  • title

    string

    Title of the workspace

  • subtitle

    string

    Subtitle to show under the name of the workspace

  • icon

    React.ComponentType

    React component to use as icon for this workspace

Examples

Minimal example

// A more plausible minimalist configuration
import { defineConfig } from 'sanity'
import { structureTool } from 'sanity/structure'
import { schemaTypes } from './schemas'

export default defineConfig({
  title: 'My cool project',
  projectId: '<project-id>',
  dataset: 'YOUR_DATASET',
  plugins: [structureTool()],
  schema: {
    types: schemaTypes,
  },
})

Multiple workspace example

import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {visionTool} from '@sanity/vision'
import {LaunchIcon} from '@sanity/icons/Launch'
import {RobotIcon} from '@sanity/icons/Robot'
import {schemaTypes} from './schemas'

export default defineConfig([
  {
    name: 'my-prod-space',
    title: 'My production workspace',
    basePath: '/production',
    icon: LaunchIcon,
    projectId: '<your-project-id>',
    dataset: '<your-dataset>',
    plugins: [structureTool()],
    schema: {
      types: schemaTypes,
    },
  },
  {
    name: 'my-staging-space',
    title: 'My staging workspace',
    basePath: '/staging',
    subtitle: 'The world is a stage',
    icon: RobotIcon,
    projectId: '<your-project-id>',
    dataset: 'staging',
    plugins: [structureTool(), visionTool({defaultApiVersion: '2026-07-01'})],
    schema: {
      types: schemaTypes,
    },
  },
])

Was this page helpful?