Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

docukit/docukit

Open more actions menu

Repository files navigation

Docukit banner

Discord npm X

Build local-first apps with type-safe documents and real-time sync.


What is Docukit?

Docukit is a set of libraries for building local-first applications: type-safe document models, real-time collaboration, and optional sync backends. Use DocNode for your document layer (with optional Lexical bindings) and DocSync when you need multi-client sync over WebSockets.

Package Description
@docukit/docnode Type-safe document manager (OT/CRDT), undo manager, and schema normalization
@docukit/docsync CRDT-agnostic sync protocol; works with DocNode, Yjs, Loro, and others
@docukit/docnode-lexical Bind DocNode to Lexical for rich-text editors and presence

Full docs, comparison tables (DocNode vs Yjs, DocSync vs Hocuspocus), and examples: docukit.dev.

Quick start

npm i @docukit/docnode
import { Doc, defineNode, string } from "@docukit/docnode";

const PageNode = defineNode({
  type: "page",
  state: { title: string(""), body: string("") },
});

const doc = new Doc({ type: "page", extensions: [{ nodes: [PageNode] }] });

doc.root.state.title.set("Hello, local-first.");

See the DocNode getting started and DocSync getting started guides for more.

Why Docukit?

  • Type-safe — Define nodes and state with TypeScript; get full inference and fewer runtime bugs.
  • Local-first — Documents live locally; sync when connected. Works offline and scales to real-time.
  • Flexible — Use DocNode alone, or add DocSync for server-backed sync. DocSync is CRDT-agnostic, so you can pair it with Yjs, Loro, or other CRDTs if you prefer.

Links


Contributing / local dev: pnpm i then pnpm dev.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.