Visit [our website](https://docukit.dev) for documentation and more.


Keywords
sync, sync engine, real-time, collaborative, collaboration, rtc, conflict-resolution, CRDT, OT, Operational Transformation, document, local-first, offline-first, editor, lexical, loro, loro-crdt, operational-transformation, prosemirror, real-time-collaboration, rich-text-editor, rte, sync-engine, synchronization, tiptap, tree, yjs
License
ICU
Install
npm install @docukit/docsync@0.4.1-alpha.2

Documentation

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.