Registry / cms / sanity-plugin-fieldwork

sanity-plugin-fieldwork

JSON →
library2.0.0jsnpmunverified

Fieldwork is a Sanity Studio v3 plugin that lets you inspect your Sanity.io schema fields directly within the Studio interface. It helps developers review existing schema structures, identify field reuse opportunities, and model data more effectively. The current stable version is 2.0.0. It is primarily used by Sanity developers for schema visualization and analysis. Compared to alternatives like custom schema inspection tools, Fieldwork integrates seamlessly into the Sanity Studio and requires minimal setup. The plugin ships TypeScript types and has a stable release cadence, focusing on compatibility with Sanity v3 and React 18.

npm install sanity-plugin-fieldwork
INSTALL
IMPORT
SIG · SANITY-PLUGIN-FIEL
S
sanity-plugin-fieldwork
cmsjavascriptv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fieldwork
import { fieldwork } from 'sanity-plugin-fieldwork'
import fieldwork from 'sanity-plugin-fieldwork'
The plugin exports a named function; default import is not supported.
fieldwork (with options)
import { fieldwork } from 'sanity-plugin-fieldwork'; fieldwork({})
fieldwork()
The function expects an options object; calling it without arguments may cause runtime errors.
CommonJS require
const { fieldwork } = require('sanity-plugin-fieldwork')
const fieldwork = require('sanity-plugin-fieldwork')
CJS require must destructure the named export; direct require yields the module, not the function.
TypeScript usage
import type { FieldworkOptions } from 'sanity-plugin-fieldwork'
import { FieldworkOptions } from 'sanity-plugin-fieldwork'
Options type is exported as a named type; if using type-only import, use `import type`.

Shows how to import and register the fieldwork plugin in a Sanity Studio v3 configuration file.

// sanity.config.ts import { defineConfig } from 'sanity'; import { fieldwork } from 'sanity-plugin-fieldwork'; export default defineConfig({ projectId: process.env.SANITY_STUDIO_PROJECT_ID ?? '', dataset: process.env.SANITY_STUDIO_DATASET ?? 'production', plugins: [fieldwork({})], }); // After adding, the Fieldwork tool appears in the Studio sidebar.
Debug
Known issues
gotchaThe plugin requires Sanity Studio v3 and React 18. It will not work with v2.
fix
Ensure your Studio runs Sanity v3 and React 18.
affects: >=2.0.0
gotchaThe fieldwork() function must be called with an options object, even if empty. Calling it without arguments silently fails.
fix
Use fieldwork({}) instead of fieldwork().
affects: >=2.0.0
deprecatedVersion 1.x is deprecated. Upgrade to v2 for Sanity v3 compatibility.
fix
Update package to sanity-plugin-fieldwork@^2.0.0 and migrate to Sanity v3.
affects: <2.0.0
gotchaThe plugin exports a named export 'fieldwork', not a default export. Default imports yield undefined.
fix
Use import { fieldwork } from 'sanity-plugin-fieldwork'.
affects: >=2.0.0
gotchaCommonJS require must destructure the named export. Direct require returns the module object, not the function.
fix
Use const { fieldwork } = require('sanity-plugin-fieldwork').
affects: >=2.0.0
Errors
Common errors & fixes
Module '"sanity-plugin-fieldwork"' has no exported member 'fieldwork'. Did you mean to use 'import fieldwork from "sanity-plugin-fieldwork"' instead?
TypeScript or bundler error when trying to import as default export.
fix
Use import { fieldwork } from 'sanity-plugin-fieldwork'.
TypeError: fieldwork is not a function
Using CommonJS require without destructuring: const fieldwork = require('sanity-plugin-fieldwork') returns an object.
fix
Use const { fieldwork } = require('sanity-plugin-fieldwork').
Plugin "fieldwork" could not be loaded. Check that it's correctly installed and configured.
The plugin is not installed or the import path is incorrect.
fix
Run npm install sanity-plugin-fieldwork and verify the import statement.
fieldwork is not a plugin. Did you forget to call it?
Calling fieldwork() without arguments or using it as a plain object instead of a function call.
fix
Use fieldwork({}) in the plugins array.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
reactrequiredPeer dependency required by Sanity Studio plugins; runtime for UI components.
sanityrequiredPeer dependency; Sanity v3 Studio core library.
Agent activity
42 hits · last 30 days
node
40
Resources
sanity-plugin-fieldwork — npm install sanity-plugin-fieldwork · libregistry