Yjs
Shared state / CRDT · Free
A CRDT library of shared data types with providers: synchronizes concurrent text and state editing between clients.
Also known as: yjs/yjs; yjs

What you can use for free
Code and local use under MIT.
Paid features and costs
Computing resources, self-hosting, and external services are paid for separately if used.
Access and limitations
Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.
Use cases
- Synchronize collaborative editing between clients
- Connect a provider and check concurrent edits/reconnect between two clients
Example workflow
A possible workflow; this is not a report of hands-on testing.
Synchronize collaborative editing between clients.
Before you start
- A document model and concurrent updates.
- A client application and transport provider.
Steps
- Describe the document's shared text/map types.
- Connect a provider and check concurrent edits/reconnect between two clients.
- Test offline edits, merging, and reconnecting.
Check your result
- Clients converge on one state after conflicting changes.
- Transport authorization and history size suit the project.
Choosing Yjs
Synchronize collaborative editing between clients
Choose this when
- Synchronize collaborative editing between clients
- Connect a provider and check concurrent edits/reconnect between two clients
Consider alternatives when
- When choosing for this topic, compare Yjs with Automerge. A candidate to compare under the topic: APIs and server SDKs, Realtime and notifications. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- When choosing for this topic, compare Yjs with Liveblocks. A candidate to compare under the topic: APIs and server SDKs, Realtime and notifications. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
Requirements
- Choose a network provider to exchange updates and a persistence provider for local storage. The README demonstrates y-websocket or y-webrtc combined with y-indexeddb, rather than networking built into one core package.
Things to consider
- Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.
- Terms of use: MIT for the code; dependencies have separate licenses.
- One shared type can occupy only one place in Y.Doc. In the example, the same Y.Array cannot be added again under another key: an already integrated type causes an error.
Frequently asked questions
What can you use for free in Yjs?
Code and local use under MIT.
What additional costs might arise with Yjs?
Computing resources, self-hosting, and external services are paid for separately if used.
What terms of use matter for Yjs?
MIT for the code; dependencies have separate licenses.
How do you get started with Yjs?
Describe the document's shared text/map types. Connect a provider and check concurrent edits/reconnect between two clients. Test offline edits, merging, and reconnecting.
Is installing yjs enough to connect clients and save offline changes?
The core provides shared types and change observation. Networking and bindings are separate modules; providers can be combined. y-indexeddb stores updates in the browser, while the network provider handles transmission.
Related tasks and approaches
- Automerge
A candidate to compare under the topic: APIs and server SDKs, Realtime and notifications. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- Liveblocks
A candidate to compare under the topic: APIs and server SDKs, Realtime and notifications. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- PartyKit
A candidate to compare under the topic: APIs and server SDKs, Realtime and notifications. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
License
MIT for the code; dependencies have separate licenses.
MIT — permissive license
You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.
License termsTechnologies and topics
- Yjs
- collab
- Development