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

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.

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

npm i @docukit/docnodeimport { 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.

- 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.

Contributing / local dev: pnpm i then pnpm dev.