# @sanity/uuid

> Simple generation of sanity document IDs

Latest version **3.0.3** (published 2026-06-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sanity/uuid
pnpm add @sanity/uuid
yarn add @sanity/uuid
bun add @sanity/uuid
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2026-06-12 |
| First published | 2017-05-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sanity.io |
| Maintainers | sanity-svc.npm, sanity-io |
| Keywords | sanity, cms, headless, realtime, content, uuid |

## Links

- npm: https://www.npmjs.com/package/@sanity/uuid
- Repository: https://github.com/sanity-io/uuid
- Homepage: https://www.sanity.io/
- Issues: https://github.com/sanity-io/uuid/issues
- npm.io page: https://npm.io/package/@sanity/uuid

## Dependencies (1)

- [uuid](https://npm.io/package/uuid.md) ^11.0.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 3.0.3 (latest) — 2026-06-12
- 2.0.10-canary.0 (canary) — 2020-11-05
- 1.150.9-review-changes.1024 (review-changes) — 2020-10-07
- 1.148.5-document-actions.23 (document-actions) — 2020-02-18
- 0.147.10-next.23 (next) — 2020-02-11
- 0.147.10-ts-client.1 (ts-client) — 2020-01-15
- 0.147.0-handle-access-control-errors.38 (handle-access-control-errors) — 2019-12-09
- 0.146.4-hints-mode.156 (hints-mode) — 2019-12-09
- 0.147.0-block-tools-white-space-fix.2 (block-tools-white-space-fix) — 2019-11-27
- 0.147.0-alpha.2 (asset-sources) — 2019-11-27
- 0.144.4-cheesy-bites.121 (cheesy-bites) — 2019-11-18
- 0.143.0-initial-value-templates.55 (initial-value-templates) — 2019-10-24
- 0.139.3-parrot.0 (alpha) — 2018-12-25
- 0.140.0-alpha.4 (realtime-block-editor) — 2018-12-20
- 0.136.1-canary.66 (graphql) — 2018-12-13
- … 370 more at https://npm.io/package/@sanity/uuid/versions

## README

# @sanity/uuid

> [!WARNING]
> This package is no longer needed/encouraged - use `crypto.randomUUID()` or the `uuid` npm module directly.

Generate a valid Sanity document ID (uuid v4 format)

## Installation

```sh
$ npm install @sanity/uuid
// or
$ yarn add @sanity/uuid
```

## Usage

```js
import {uuid} from '@sanity/uuid'

const id = uuid()
console.log(id)
//=> 76dc5edf-9c43-4bab-a62d-4a2cad650053
```

## License

MIT © [Sanity.io](https://www.sanity.io/)

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