# @cms-lab/sanity

> Sanity document adapter for cms-lab.

Latest version **1.2.6** (published 2026-05-26) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @cms-lab/sanity
pnpm add @cms-lab/sanity
yarn add @cms-lab/sanity
bun add @cms-lab/sanity
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.6 |
| Published | 2026-05-26 |
| First published | 2026-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.10 |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | Afaq Rashid |
| Maintainers | afaqrashid |
| Keywords | cms, sanity, testing |

## Links

- npm: https://www.npmjs.com/package/@cms-lab/sanity
- Repository: https://github.com/i-afaqrashid/cms-lab
- Homepage: https://cmslab.afaqrashid.com
- Issues: https://github.com/i-afaqrashid/cms-lab/issues
- npm.io page: https://npm.io/package/@cms-lab/sanity

## Dependencies (1)

- [@cms-lab/core](https://npm.io/package/@cms-lab/core.md) 1.2.6

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.2.6 (latest) — 2026-05-26
- 1.2.5 — 2026-05-26
- 1.2.4 — 2026-05-26
- 1.2.3 — 2026-05-26
- 1.2.2 — 2026-05-26
- 1.2.1 — 2026-05-26
- 1.2.0 — 2026-05-26
- 1.1.0 — 2026-05-26
- 1.0.10 — 2026-05-26
- 1.0.9 — 2026-05-25
- 1.0.8 — 2026-05-25
- 1.0.6 — 2026-05-25
- 1.0.5 — 2026-05-25

## README

# @cms-lab/sanity

Sanity adapter for cms-lab.

```ts
cms: {
  provider: "sanity",
  projectId: "my-project",
  dataset: "production",
  apiVersion: "2025-02-19",
  token: process.env.SANITY_READ_TOKEN,
  contentTypes: [
    {
      type: "page",
      documentType: "page",
      uidField: "slug.current",
      urlField: "seo.canonical",
    },
  ],
}
```

The adapter reads Sanity documents through the HTTP Query API, one configured
document type at a time, and normalizes them into cms-lab `CMSDocument` objects.
Documents whose `_id` starts with `drafts.` are marked as drafts.

Use `uidField` or `urlField` when your project stores route values in custom
fields. Both options read dotted paths from `document.data`.

See the public [adapter maturity matrix](https://cmslab.afaqrashid.com/docs/tested-with)
for current test coverage and known limits.

## Release History

See the repository [changelog](https://github.com/i-afaqrashid/cms-lab/blob/main/CHANGELOG.md)
and [GitHub Releases](https://github.com/i-afaqrashid/cms-lab/releases) for
version-by-version notes.

## Open Source

MIT licensed. See the repository [license](https://github.com/i-afaqrashid/cms-lab/blob/main/LICENSE), [contributing guide](https://github.com/i-afaqrashid/cms-lab/blob/main/CONTRIBUTING.md), and [support guide](https://github.com/i-afaqrashid/cms-lab/blob/main/SUPPORT.md).

---
_Source: https://npm.io/package/@cms-lab/sanity · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
