Yjs Collaborative Demo
This demo showcases real-time collaborative text editing using Yjs (Yet Another JSON) CRDT library.
Features
- Real-time collaboration: Multiple users can edit the same document simultaneously
- Conflict-free updates: Yjs automatically merges concurrent edits without conflicts
- Server-Sent Events: Uses SSE for real-time updates (no WebSockets required)
- Document persistence: Changes are broadcast to all connected clients
- Client tracking: Shows the number of connected clients
How it works
- The
<doc-provider>component connects to a Yjs-enabled Durable Object - Each client maintains a local Yjs document that syncs with the server
- Local changes are sent to the server via POST requests
- Remote changes are received via Server-Sent Events
- Yjs automatically handles conflict resolution and document merging
Try it out
Open this page in multiple browser tabs or share the URL with others to see real-time collaboration in action.