Collaboration
Overview
Collaboration in Kritzel is built on sync providers, the same mechanism used for persistence. Register collaboration providers through the editor's syncConfig prop to control where and how document state is shared across tabs and users. Providers are composable and can combine local browser channels with network transport.
Kritzel comes with the following built-in collaboration providers:
Cross-Tab Sync
Use BroadcastSyncProvider to synchronize document updates across browser tabs on the same device through the BroadcastChannel API.
Real-Time Multi-User Sync
To collaborate across devices or users, combine local persistence with a network provider. A common production pattern uses IndexedDBSyncProvider for offline resilience together with HocuspocusSyncProvider (or WebSocketSyncProvider) for real-time sync. The HocuspocusSyncProvider also supports connection multiplexing for managing multiple documents efficiently.
API Details
For the full list of related APIs, see the following reference sections.