Collaboration SDK overview
Understand what the Univer Collaboration SDK solves, how its modules compose, its extension points, and the product boundaries your application retains.
The Univer Collaboration SDK is a server-side collaboration SDK for the Univer document model. It provides operational transformation (OT), revisions, snapshots, realtime synchronization, and persistence so multiple Univer clients can edit the same authoritative Unit.
Developers embed it in their own Node.js application, integrate identity and authorization through Middleware, and extend logging and other application logic through Middleware or Events. A Database Adapter separately connects collaboration data to the application's database.
What it solves
The Univer Runtime SDK presents and edits Sheet, Doc, Slide, Board, and Base content in the browser. Adding multi-user editing also requires a server authority that loads content, confirms concurrent changes, advances revisions, and lets disconnected clients recover to a consistent state.
It fits applications that:
- already use Univer to build an editor and need realtime multi-user editing;
- want to host collaboration data and choose their own database;
- need to connect existing identity, authorization, or tenant rules to collaboration operations;
- need History, Thread Comment, or Worktree capabilities on top of core collaboration.
One complete collaboration service
| Module | Primary responsibility |
|---|---|
| Collaboration Client | Loads Units, submits changesets, and maintains browser collaboration state |
| Node Transport | Receives HTTP/WebSocket traffic and runs application entry middleware |
UniverCollabEndpoint | Implements the client protocol, Sessions, Rooms, Presence, ACKs, and broadcasts |
UniverCollabService | Manages Unit lifecycle, performs OT, and confirms continuous revisions |
| Database Adapter | Atomically stores snapshots, changesets, revisions, and submission idempotency state |
What the SDK provides
Core capabilities include:
- creating, loading, deleting, and recovering Sheet, Doc, Slide, Board, and Base Units;
- snapshots, changesets, revisions, OT, and submission idempotency;
- HTTP content loading plus WebSocket Sessions, Rooms, Presence, ACKs, and broadcasts;
- Middleware at the Transport, Endpoint, and Service boundaries;
- process-local Events for Unit creation, changeset commits, deletion, and recovery;
- Memory, SQLite, and custom Database Adapter contracts.
After the core path works, applications can add version history, Thread Comments, Worktree drafts, and server-side Office file exchange. These capabilities have their own Services, Middleware, Events, or Database Adapters.
What the application owns
| Collaboration SDK | Application |
|---|---|
| Unit collaboration state | Users, tenants, hierarchy, and sharing relationships |
| OT, revisions, and snapshots | Login, Sessions, and identity mapping |
| Collaboration Sessions, Rooms, and Presence | Roles, ACLs, and product policy |
| Collaboration Database Adapters | Files, object storage, and product databases |
| Middleware and Event extension points | Logging, audit, metrics, and external integrations |
| Client protocol Endpoints | Business APIs and workflows such as document creation |
Three general extension points
| Extension point | Problems it solves |
|---|---|
| Middleware | Inspects or enriches Context, rejects requests, or records processing during an operation |
| Event | Observes confirmed state changes for in-process derived state or non-critical follow-up work |
| Database Adapter | Selects storage and implements atomicity, CAS, and idempotency contracts |
Identity and authorization are integrated through Middleware. Use Middleware for validation and restrictions before an operation runs, and Events to record changes or trigger follow-up work after state is confirmed. Both can support logging, request tracing, metrics, and derived-state updates. See Middleware and Events for their execution boundaries.
Where to start
- Run the quick start to verify the full path in two browsers.
- Read Module boundaries and relationships to understand why each package exists.
- Continue with Middleware and Events, Identity and authorization, or Database Adapters for your integration task.
- See Collaboration extension modules for History, Comments, Worktrees, and file exchange.