doc-manager

Installation

Add the plugin to your Sanity Studio project in under a minute.

Prerequisites

Install the package

Use your preferred package manager:

$ npm install sanity-plugin-document-manager

Add 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-here

You can generate a token from sanity.io/manage under API → Tokens. Make sure to select "Editor" or "Deploy Studio" permissions.