> For AI agents: the complete Sanity documentation index is available at [https://www.sanity.io/docs/llms.txt](https://www.sanity.io/docs/llms.txt).

# Configuration API

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

[Introduction to Studio configuration](https://www.sanity.io/docs/studio/configuration)
Learn how to configure your 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](https://reference.sanity.io/sanity/index/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`.

```javascript
// 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.

#### Properties

**projectId** (string, required)

The ID of the Sanity project to use for the studio

**dataset** (string, required)

The name of the dataset to use for the studio

**auth** (object | AuthConfig)

Lets you implement custom authentication by providing a configuration object. Read more about configuring auth providers.

**document** (object | DocumentPluginOptions)

Accepts custom components for document actions and badges, as well as a custom productionUrl resolver and default configuration for new documents. Read more about the document API.

**form** (object | SanityFormConfig)

Extensions / customizations to the Studio forms. Accepts configurations for image and file asset sources as well as custom components to override the default Studio rendering. Read more about the form API.

**plugins** (array | PluginOptions[])

Studio plugins: takes an array of plugin declarations that can be called with or without a configuration object. Read more about plugins.

**tools** (array | Tool[])

Studio tools: takes an array of tool declarations that can be called with or without a configuration object. Read more about the tool API.

**schema** (object | SchemaPluginOptions)

Schema definition: takes an array of types and an optional array of templates (initial value templates). While defining a schema is not required, there are few things inside the Studio that work without one. Read more about the schema API.

**studio** (object | StudioComponentsPluginOptions)

Accepts a components object which will let you override the default rendering of certain bits of the Studio UI. Read more about Studio components.

**theme** (object | StudioTheme)

Accepts a theme configuration object. Read more about theming.

**i18n** (object | LocalePluginOptions)

Accepts a config object for localizing the Studio UI. Read more about Studio localization.

## Additional properties for multiple workspace configurations

#### Properties

**name** (string, required)

Name of the workspace, by convention in lowercase/camelCase

**basePath** (string, required)

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

```javascript
// 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

```javascript
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,
    },
  },
])

```



## Related changelog entries

Entries are listed newest first; each link points to the full entry as markdown. Follow one when you need to know what changed, when, or why — for example, to summarize recent updates, explain behavior that differs from older documentation, or check whether a fix has shipped.

- [Sanity Studio v3.56.0: Improved document sync notification, Copying Document URL, and more](https://www.sanity.io/docs/changelog/747f94f0-8f99-43e1-a821-d58f5632458f.md) — August 27, 2024
- [Sanity Studio v3.23.0: Upgraded and refreshed Studio UI](https://www.sanity.io/docs/changelog/f75445eb-3c3e-4d1e-986d-71a61223aa83.md) — December 19, 2023
- [Sanity Studio v3.15.0: Improvements and bugfixes](https://www.sanity.io/docs/changelog/aaf2052f-80a1-4fa3-877f-6a9f7518c894.md) — August 8, 2023