Yjs

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

Library
npm
v13.6.33
22,973 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
87 /100 Excellent
Development Activity 92
Maintenance 92
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
98%
Other

Outline

Collaboration · Knowledge Management

41,045

A fast, real-time collaborative knowledge base for growing teams built on React, Node.js, and ProseMirror.

View details
91
Repo Health
87
Technical
68
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
67%
AGPL 3.0

Plane

Collaboration · Productivity · Project Management

61,353

Open-source project management platform to replace Jira, Linear, and ClickUp — with built-in cycles, real-time collaborative docs, and full self-hosting.

View details
92
Repo Health
82
Technical
77
Dependency
Built with
TypeScript 67%
Python 30%
Updated 1 weeks ago
TypeScript
96%
Other

Refly

AI Development · Automation · No Code Platforms

7,537

Build deterministic, versioned agent skills from natural language—run them anywhere from Claude Code to Slack.

View details
68
Repo Health
76
Technical
63
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
Rust
72%
Apache 2.0

Rivet

AI Agents · Developer Tools

6,326

Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.

View details
87
Repo Health
81
Technical
64
Dependency
Built with
Rust 72%
TypeScript 25%
Updated 6 days ago
TypeScript
72%
Apache 2.0

Supabase

Authentication · Databases · Developer Tools

113,827

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
62
Dependency
Built with
TypeScript 72%
MDX 26%
Updated 6 days ago
HTML
68%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,123

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
HTML 68%
JavaScript 20%
Updated 6 days ago
Rust
33%
Other

Windmill

Automation · Developer Tools

18,257

Turn scripts into webhooks, workflows, and auto-generated UIs — the fastest self-hostable workflow engine, 13x faster than Airflow.

View details
91
Repo Health
82
Technical
64
Dependency
Built with
Rust 33%
TypeScript 24%
Svelte 22%
Updated 6 days 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