AI agents: fetch the documentation index at llms.txt. Markdown versions are available by appending .md to any page URL, including this page's markdown.
@stratasync/y-doc
Yjs CRDT integration for real-time collaborative editing in Strata Sync.
Manages Y.Doc instances for collaborative text editing, handles the Yjs sync protocol, and tracks presence per document.
What it provides
- YjsDocumentManager: manages Y.Doc instances per entity field, handles sync protocol messages, tracks connection state, and derives text content from CRDT state
- YjsPresenceManager: tracks viewing/editing presence per document, signals focus/blur to the server, and receives session state updates
- Message types: typed client and server messages for the Yjs sync protocol, presence signaling, and error handling
- Utility functions:
DocumentKeyserialization helpers and message type guards
Installation
npm install @stratasync/y-doc yjsyjs is a peer dependency, so install it alongside @stratasync/y-doc.
Package exports
The root barrel re-exports the managers, persistence helpers, public types from types.ts, and the type guards.