Skip to main content
← Back to Templates

Collaborative Document

A shared text editor that uses Rivet Actors with Yjs for real-time CRDT sync and presence.

Collaborative Document

Features

  • Coordinator pattern: One documentList actor per workspace indexes document actors
  • CRDT synchronization: Document actors broadcast Yjs updates to every collaborator
  • Presence and cursors: Awareness updates flow through actor events for live cursors
  • Durable persistence: Yjs snapshots are stored in actor KV for crash recovery

Implementation

The coordinator creates document actors and tracks IDs, while each document actor stores Yjs state in KV storage and broadcasts updates.

Resources

Read more about coordinator actors, events, actions, and KV storage.