# tiptap-unique-id

> A tiptap extension that adds unique IDs to nodes

Latest version **3.4.1** (published 2025-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiptap-unique-id
pnpm add tiptap-unique-id
yarn add tiptap-unique-id
bun add tiptap-unique-id
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.4.1 |
| Published | 2025-09-06 |
| First published | 2023-02-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 146.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Thijs-Jan Huisman |
| Maintainers | tjhui |
| Keywords | tiptap, extension, tiptap extension |

## Links

- npm: https://www.npmjs.com/package/tiptap-unique-id
- npm.io page: https://npm.io/package/tiptap-unique-id

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 3.4.1 (latest) — 2025-09-06
- 2.10.3 — 2024-12-06
- 2.0.0 — 2024-07-14
- 1.2.1 — 2023-09-13
- 1.1.0 — 2023-03-19
- 1.0.2 — 2023-02-13
- 1.0.1 — 2023-02-12
- 1.0.0 — 2023-02-03

## README

# TipTap Unique ID extension

[![npm version](https://img.shields.io/npm/v/tiptap-unique-id?style=flat-square)](https://www.npmjs.org/package/tiptap-unique-id)


An extension that enables unique IDs for nodes. A JS fork of the original MIT licensed [`extension-unique-id`](https://www.npmjs.com/package/@tiptap/extension-unique-id) that has since been abandoned in favour of a closed source internal version.

## Installation

```sh
npm i tiptap-unique-id
```

## Usage

```js
import { Editor } from "@tiptap/core";
// ... extensions
import UniqueId from "tiptap-unique-id";

new Editor({
  element: document.body,
  extensions: [
    // ... extensions
    UniqueId.configure({
      attributeName: "id",
      types: ["paragraph", "heading", "orderedList", "bulletList", "listItem"],
      createId: () => window.crypto.randomUUID(),
    }),
  ],
})
```

This package is ESM only, transpiled to ES2019.

### Configuration

| Parameter   | Default                            | Description                                                                                                                                                                                                                              |
| ----------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `attribute` | `"id"`                             | The attribute to assign the value of the id to                                                                                                                                                                                           |
| `types`     | `[]`                               | A list of node types that should receive ids. The exact list you need will depend on your requirements and tiptap extensions you use.                                                                                                    |
| `createId`  | `() => window.crypto.randomUUID()` | A function, returning a different string everytime it is called. Instead of UUIDv4 created by default, [`nanoid`](https://www.npmjs.com/package/nanoid), [`hyperid`](https://www.npmjs.com/package/hyperid) or other options can be used |

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