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.
YjsDocumentManager
Manages Y.Doc instances, sync protocol, connection state, and content change tracking for collaborative editing.
Creates and caches Y.Doc instances by DocumentKey, handles the Yjs sync protocol, tracks connection state, and notifies on content changes.
Creating an instance
Provide a clientId for attribution and a connId for echo suppression.
import { YjsDocumentManager } from "@stratasync/y-doc";
import type { YjsDocumentManagerConfig } from "@stratasync/y-doc";
const config: YjsDocumentManagerConfig = {
clientId: "client-abc-123",
connId: "conn-xyz-456"