Skip to main content
All configuration options and events for real-time collaboration. If you need to combine collaboration with headless SDK automation, see SDK collaboration sessions.

Configuration

You manage the Yjs provider: works with SuperDoc Yjs, Liveblocks, Hocuspocus, etc.
Use modules.collaboration = { ydoc, provider } when the editor should start in collaboration mode. If you want to open the document locally first and create a shared room later, use superdoc.upgradeToCollaboration() instead.
Y.Doc
required
Your Yjs document instance
Object
required
Any Yjs-compatible provider

User configuration

Object
required
Current user information for presence/awareness
string[]
Color palette for user cursors and selections. Users are automatically assigned colors from this palette.

Media upload

Handle image uploads in collaborative documents:

Events

onCollaborationReady

Fired when collaboration sync is complete.

onAwarenessUpdate

Fired when users join, leave, or update their presence.
states array item properties:

onLocked

Fired when the document is locked or unlocked.

Provider events

Listen to provider events directly for connection status: