Yjs exposes Map, Array, and text-like shared types that merge concurrent edits without conflicts, sync over varied networks, and support offline use with optional providers.
Overview
Yjs is a conflict-free replicated data type implementation for building multi-user software. Shared types behave like ordinary data structures while propagating changes to peers and reconciling concurrent updates automatically, which suits collaborative editors, notes, diagrams, and other realtime document experiences.
The core library focuses on in-memory shared documents, awareness metadata, undo and redo, relative positions, and version snapshots. Network transports, persistence, and editor bindings live in separate modules so applications can mix WebSocket backends, WebRTC peer sync, Matrix or other relays, IndexedDB offline storage, and database-backed servers as needed. Many production adopters use it across notes, spreadsheets, IDEs, and visual tools.
Providers can be combined—for example a network provider with a browser persistence layer—so documents load quickly from local storage and continue syncing when connectivity returns. The design is network agnostic and peer-to-peer friendly, scaling to large documents and many simultaneous editors when paired with an appropriate backend.
Developers integrate Yjs when they need merged collaborative state without a single central editor lock, especially alongside existing rich-text or canvas libraries through published bindings.
Key features
- Shared Map, Array, and text types
- Automatic merge without edit conflicts
- Undo, redo, and snapshot support
- Awareness and shared cursor data
- Pluggable sync and persistence providers
- Offline-first with IndexedDB helpers
- WebSocket and WebRTC provider options
- Bindings for common editors and frameworks
Use cases
- Realtime collaborative text editing
- Multi-user whiteboards and diagrams
- Shared notes and knowledge bases
- Embedded co-editing in SaaS products
- Peer-to-peer or decentralized sync