Collaboration
Overview
Collaboration in Upmade 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.
Upmade 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.
By default, the tabs share only the document. To share presence between the tabs as well, that is the cursors and selections of users and the agents of each tab, use BroadcastSyncProvider.with({ awareness: true }). See Broadcast Provider.
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.
Network providers share presence: collaborators see each other's cursors and selections, and the agents of each editor.
API Details
For the full list of related APIs, see the following reference sections.