Installation
Add the plugin to your Sanity Studio project in under a minute.
Prerequisites
- Sanity Studio v3, v4, or v5
- React 18 or 19
- Node.js 18 or later
Install the package
Use your preferred package manager:
$ npm install sanity-plugin-document-managerAdd to your Sanity config
sanity.config.ts
import { defineConfig } from 'sanity'
import { documentManager } from 'sanity-plugin-document-manager'
export default defineConfig({
name: 'default',
title: 'My Studio',
projectId: 'your-project-id',
dataset: 'production',
plugins: [
documentManager(),
],
})Set up the environment variable
The plugin needs a Sanity token with read and write access to fetch documents and perform deletions. Create a .env file in your project root:
.env
SANITY_STUDIO_WRITE_TOKEN=your-token-hereYou can generate a token from sanity.io/manage under API → Tokens. Make sure to select "Editor" or "Deploy Studio" permissions.