Yjs

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

Library
npm
v13.6.32
22,369stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
88/100Excellent
Development Activity92
Maintenance96
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
89/100Excellent
Architecture92
Code Quality90
Innovation90
Learning Curve80

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

TypeScript
88%
Other

AFFiNE

Productivity · Project Management · Note Taking

71,668

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
68
Dependency
Built with
TypeScript88%
Updated today
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

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

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
84%
MIT

Amical

Note Taking · AI Assistants

1,495

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

View details
79
Repo Health
82
Technical
67
Dependency
Built with
TypeScript84%
Updated 3 weeks ago
TypeScript
66%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,707

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

View details
94
Repo Health
79
Technical
68
Dependency
Built with
TypeScript66%
Java22%
Updated today
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

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

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
TypeScript
99%
Apache 2.0

Colanode

Knowledge Management · Team Chat · Collaboration

5,018

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
47
Repo Health
73
Technical
73
Dependency
Built with
TypeScript99%
Updated 4 months ago
TypeScript
95%
AGPL 3.0

Docmost

Productivity · Note Taking · Collaboration

21,411

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
71
Dependency
Built with
TypeScript95%
Updated yesterday
Python
51%
MIT

Docs

File Storage · CMS

16,733

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
87
Repo Health
81
Technical
72
Dependency
Built with
Python51%
TypeScript42%
Updated 2 days ago
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,437

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
70
Repo Health
90
Technical
62
Dependency
Built with
Java34%
TypeScript27%
Scala26%
Updated 1 weeks 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

Search