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 SDK for the Univer document model. It handles operational transformation (OT1), revisions2, snapshots, realtime synchronization, and persistence, so that multiple Univer clients can edit the same authoritative Unit.
Applications embed the SDK in their Node.js services. Identity and authorization connect through Middleware, and logging and other application logic attach to Middleware or Events. A separate Database Adapter connects collaboration data to the application's database.
It is not a complete document product
The SDK provides only the collaboration core. Users, roles, hierarchy, sharing, file spaces, and business workflows are outside its scope, and the application still owns those product capabilities and their data models.
What it solves
The Web SDK displays and edits Sheet, Doc, Slide, Board, Base, and PDF content in the browser. Realtime multi-user editing requires a server-side authority on top of the Web SDK. That authority loads content, confirms concurrent changes, advances revisions, and lets a disconnected client recover to a consistent state.
It fits applications that:
- already use Univer to build an editor and want realtime multi-user editing;
- want to host collaboration data themselves and choose their own database;
- need to connect existing identity, authorization, or tenant rules to collaboration operations;
- need History, Thread Comment, Worktree, file storage, or Office import and export on top of core collaboration.
One complete collaboration service
| Module | Primary responsibility |
|---|---|
| Collaboration Client | Loads Units, submits changesets, and keeps the browser's collaboration state current |
| Node Transport | Receives HTTP/WebSocket traffic and runs the application's entry Middleware |
UniverCollabEndpoint | Implements the client protocol, Sessions, Rooms, Presence, ACKs, and broadcasts |
UniverCollabService | Manages the Unit lifecycle, performs OT, and confirms continuous revisions |
| Database Adapter | Stores snapshots, changesets, revisions, and submission idempotency state atomically |
What the SDK provides
Core capabilities include:
- creating, loading, deleting, and recovering Units for Sheet, Doc, Slide, Board, Base, and PDF;
- snapshots, changesets, revisions, OT, and submission idempotency;
- HTTP content loading, along with 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;
- storage for collaboration data through a built-in or custom Database Adapter;
- horizontal scaling through multi-node deployment: nodes cooperate through a pub/sub adapter and a shared Session Ticket store, and the SDK provides a Redis implementation.
Once the core path is in place, applications can add version history, Thread Comments, Worktree drafts, file storage, and server-side Office import and export. Each of those capabilities has its 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 and File Database Adapters | Product databases and storage operations |
| 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 a request, or records what happened while an operation runs |
| Event | Observes confirmed state changes to update in-process derived state or start non-critical follow-up work |
| Database Adapter | Selects where data lives and implements the atomicity, CAS, and idempotency contracts |
Identity and authorization connect through Middleware. Middleware validates and restricts an operation before it runs, and Events record changes or trigger follow-up work once state is confirmed. Either can carry logging, request tracing, metrics, and derived-state updates. Middleware and Events explains where each one runs.
Where to start
- Run the quick start and check the full path in two browsers.
- Read Module boundaries and relationships to understand why each package exists.
- Choose Middleware and Events, Identity and authorization, or Database Adapters for the integration task at hand.
- Go to Collaboration extension modules for History, Comments, Worktrees, file storage, and import and export.
Footnotes
-
Operational transformation (OT) adjusts operations created concurrently against different document revisions so they can be applied consistently. It operates on edits, rather than replacing the whole document with whichever snapshot arrives last. ↩
-
A revision identifies a position in a Unit’s confirmed edit history. A changeset contains the operations in a submission; its confirmation advances that history. A revision is not an SDK package version or a timestamp. ↩
How is this guide?