doc-manager

Configuration

The plugin works with zero configuration, but every aspect can be customized via plugin options.

Full example

sanity.config.ts
import { defineConfig } from 'sanity'
import { documentManager } from 'sanity-plugin-document-manager'

export default defineConfig({
  plugins: [
    documentManager({
      // Custom tool title in the Studio navbar
      title: 'Content Manager',

      // Number of documents per page (default: 50)
      pageSize: 100,

      // Sanity API version (default: '2024-06-01')
      apiVersion: '2024-06-01',

      // Hide specific document types from the filter dropdown
      excludeTypes: ['sanity.imageAsset', 'sanity.fileAsset'],

      // Pre-select a dataset on load
      defaultDataset: 'production',
    }),
  ],
})

Options reference

OptionTypeDefaultDescription
titlestring'Document Manager'Tool title in the Studio navbar.
iconComponentTypeDatabaseIconReact component used as the tool icon.
pageSizenumber50Number of documents shown per page.
apiVersionstring'2024-06-01'Sanity API version for GROQ queries.
excludeTypesstring[][]Document types hidden from the type dropdown.
defaultDatasetstringPre-select a specific dataset on load.

Environment variables

The plugin reads the Sanity write token from your environment. It checks these variables in order:

The token needs read + write access so it can both query documents and perform bulk deletions.