Yjs

A high-performance CRDT that exposes shared data types for building conflict-free, real-time collaborative applications.

Library
npm
v13.6.33
22,849 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
88 /100 Excellent
Development Activity 92
Maintenance 96
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
89 /100 Excellent
Architecture 92
Code Quality 90
Innovation 90
Learning Curve 80

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 25 apps in this directory

TypeScript
82%
Other

AFFiNE

Collaboration · Note Taking · Productivity

73,040

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 82%
Rust 11%
Updated 5 days ago
TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
TypeScript
89%
MIT

Amical

AI Assistants · Note Taking · Voice AI

1,540

Local-first AI dictation that understands your active app — private, offline, and built for speed.

View details
82
Repo Health
82
Technical
68
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
TypeScript
68%
Apache 2.0

Appsmith

Automation · Developer Tools · No Code Platforms

40,959

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
93
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 68%
Java 21%
Updated 6 days ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

52,202

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
89
Repo Health
84
Technical
70
Dependency
Built with
TypeScript 99%
Updated 4 days ago
TypeScript
99%
Apache 2.0

Colanode

Collaboration · Knowledge Management · Team Chat

5,152

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.

View details
46
Repo Health
73
Technical
70
Dependency
Built with
TypeScript 99%
Updated 6 months ago
TypeScript
95%
AGPL 3.0

Docmost

CMS · Collaboration · Note Taking

21,801

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.

View details
89
Repo Health
70
Technical
69
Dependency
Built with
TypeScript 95%
Updated 5 days ago
Python
47%
MIT

Docs

CMS · File Storage

16,868

Open-source collaborative knowledge platform with real-time editing, AI writing tools, and full self-hosting control — built by the French and German governments.

View details
88
Repo Health
81
Technical
68
Dependency
Built with
Python 47%
TypeScript 45%
Updated 4 days ago
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,441

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.

View details
59
Repo Health
90
Technical
61
Dependency
Built with
Java 34%
TypeScript 27%
Scala 26%
Updated 1 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers