Yjs
A high-performance CRDT that exposes shared data types for building conflict-free, real-time collaborative applications.
Repository Health
Technical Analysis
Yjs is a CRDT (Conflict-free Replicated Data Type) implementation that exposes its internal state as shared data types such as Map, Array, and Text. Changes made by any peer are automatically distributed and merged without conflicts, so multiple users can edit the same document simultaneously. Yjs is network-agnostic and works over WebSockets, WebRTC, or any other transport, with first-class support for offline editing, version snapshots, undo/redo, and shared cursors. It powers real-time collaboration in editors and applications like ProseMirror, TipTap, Monaco, CodeMirror, and many production products.
What You Get
- Shared data types (Y.Map, Y.Array, Y.Text, Y.XmlFragment) that merge concurrent edits without conflicts
- A compact binary update and state-vector encoding for efficient sync and delta exchange
- Built-in undo/redo, relative positions, version snapshots, and change observation events
- A network-agnostic core that plugs into WebSocket, WebRTC, IndexedDB, and custom providers
- Editor bindings for ProseMirror, TipTap, Monaco, CodeMirror, Quill, Slate, and more
Common Use Cases
- Adding Google-Docs-style real-time collaboration to a rich-text or code editor
- Building offline-first apps that sync and merge cleanly when connectivity returns
- Synchronizing shared application state across many clients without a central lock
- Implementing collaborative whiteboards, diagrams, and design tools with live cursors
Under The Hood
Architecture — Yjs models a document as a Doc containing shared types that are backed by a doubly-linked list of Item structs stored in a StructStore. Each item carries a unique ID (client id + clock), and concurrent operations are ordered deterministically using the YATA algorithm so every peer converges to the same state. Deletions are tracked in an IdSet/delete set, garbage collection reclaims tombstoned content, and all mutations flow through a Transaction that batches changes and emits observer events. Updates are serialized through UpdateEncoder/UpdateDecoder (V1 and V2 formats) with state vectors enabling differential sync.
Tech Stack — The library is written in modern ES modules (Node >= 22) with types supplied via JSDoc and compiled by TypeScript. Its only runtime dependency is lib0, a low-level utility library (efficient binary encoding, data structures) by the same author. Bundling is handled by Rollup, linting by standard and markdownlint, and circular-dependency checks by dpdm. The package ships tree-shakeable ESM with no side effects.
Code Quality — The repository has a substantial, well-organized test suite (y-array, y-map, y-text, y-xml, encoding, snapshots, undo-redo, relative positions, and compatibility tests) run with high repetition and randomized/fuzz-style testing to stress the CRDT invariants. Code is consistently structured into structs/ and utils/ modules, with an explicit INTERNALS.md, threat model, and security policy. Naming is precise and the public surface is deliberately curated in index.js.
API Design — The public API is ergonomic: shared types read and write like native collections, so ymap.set('key', value) or yarray.insert(0, [item]) is all it takes to produce a synced mutation. Observation is event-driven (observe, observeDeep) and updates are plain Uint8Arrays that you route over any transport, keeping the core decoupled from networking. Extensive documentation at docs.yjs.dev, a large demos repository, and a rich ecosystem of bindings smooth the path from prototype to production.
Used by 24 apps in this directory
AFFiNE
Productivity · Project Management · Note Taking
Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.
APITable
Low Code Platforms · Databases
API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.
Amical
Note Taking · AI Assistants
Local-first AI dictation that understands your active app — private, offline, and built for speed.
Appsmith
Developer Tools · Automation · No Code Platforms
Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.
Cherry Studio
AI Assistants
All-in-one AI desktop client with 300+ assistants and multi-model support
Colanode
Knowledge Management · Team Chat · Collaboration
Local-first, self-hosted workspace that combines real-time chat, Notion-style pages, and structured databases — all synced via CRDTs so you work offline without losing a keystroke.
Docmost
Productivity · Note Taking · Collaboration
Self-hosted collaborative wiki and knowledge base with real-time editing, diagrams, AI assistance, and enterprise access controls — a modern alternative to Confluence and Notion.
Docs
File Storage · CMS
Open-source collaborative knowledge platform with real-time editing, AI writing tools, and full self-hosting control — built by the French and German governments.
Enso
Analytics · Data Engineering · Low Code Platforms
A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.