Yjs

High-performance CRDT (Conflict-free Replicated Data Type) implementation for building real-time collaborative applications. Yjs provides shared data structures (Y.Map, Y.Array, Y.Text, Y.XmlFragment) that sync automatically across clients with conflict-free merging. Used by major collaborative editors (Notion, Linear, Liveblocks are built on similar patterns). Agent use: shared state management for multi-agent systems where multiple agents need to write to shared documents or data structures without conflicts.

Evaluated Mar 06, 2026 (0d ago) v13.x
Homepage ↗ Repo ↗ Developer Tools crdt collaboration real-time offline-first local-first p2p open-source
⚙ Agent Friendliness
60
/ 100
Can an agent use this?
🔒 Security
76
/ 100
Is it safe for agents?
⚡ Reliability
78
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
78
Error Messages
70
Auth Simplicity
90
Rate Limits
90

🔒 Security

TLS Enforcement
85
Auth Strength
70
Scope Granularity
65
Dep. Hygiene
85
Secret Handling
80

Security entirely depends on sync provider implementation. Core library is open-source MIT for auditability. No built-in auth or access control. End-to-end encryption possible but requires additional implementation.

⚡ Reliability

Uptime/SLA
72
Version Stability
80
Breaking Changes
78
Error Recovery
80
AF Security Reliability

Best When

You're building collaborative editing features (docs, code, design tools) or multi-agent shared state that needs offline-first, conflict-free concurrent updates.

Avoid When

You need central authority over state mutations, complex business logic on state changes, or strict linearizable consistency — use event sourcing or a database with transactions instead.

Use Cases

  • Build real-time collaborative text editors with offline support using Yjs + Tiptap/ProseMirror/Quill bindings without conflict resolution logic
  • Implement multi-agent shared state where agents write to Yjs Y.Map and changes propagate to all subscribers without coordination locks
  • Create offline-capable web applications with Yjs + IndexedDB persistence that sync when connectivity is restored
  • Share live coding environments with real-time collaborative editing using Yjs + CodeMirror or Monaco Editor bindings
  • Build distributed data structures for agent knowledge bases that multiple agents can update concurrently with automatic conflict resolution

Not For

  • Server-authoritative applications requiring strict consistency — Yjs CRDTs are eventually consistent; for strict ordering use operational transforms with a central server
  • Applications needing complex business logic on mutations — Yjs merges operations mathematically, not via business rules; use event sourcing for logic-heavy state
  • Very large documents (>10MB) — Yjs document size affects performance; split large datasets into multiple documents

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Yjs is a client-side CRDT library — no auth built-in. Providers (y-websocket, y-webrtc, y-indexeddb) handle transport and must implement their own auth. y-websocket server supports JWT auth. Auth is provider-specific, not Yjs-native.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Core Yjs library is MIT open source. Sync infrastructure must be self-hosted (y-websocket, y-webrtc) or use a third-party hosted service (Liveblocks, PartyKit, Hocuspocus Cloud). Infrastructure costs are external to Yjs itself.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Yjs documents are binary-encoded (Uint8Array) — agents cannot directly inspect document state without decoding; use Y.Map.get() and Y.Array.toArray() for reading
  • Undo/redo in Yjs requires Y.UndoManager — standard undo stacks are per-client and don't account for remote changes; multi-agent undo requires careful design
  • Y.Doc must be initialized with same document ID on all peers for sync to work — mismatched IDs create separate documents that never merge
  • Subdocuments (nested Y.Doc) are supported but require separate sync subscription — parent document sync doesn't automatically sync subdocuments
  • Memory management: Yjs retains deleted content as tombstones for CRDT correctness — very long-lived documents accumulate state that cannot be fully garbage collected
  • Provider selection matters: y-webrtc is peer-to-peer (no server needed but unreliable), y-websocket requires a server, y-indexeddb is local-only — choose based on deployment architecture

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Yjs.

$99

Scores are editorial opinions as of 2026-03-06.

5211
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered