Skip to content
2 min

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

ModulePrimary responsibility
Collaboration ClientLoads Units, submits changesets, and maintains browser collaboration state
Node TransportReceives HTTP/WebSocket traffic and runs application entry middleware
UniverCollabEndpointImplements the client protocol, Sessions, Rooms, Presence, ACKs, and broadcasts
UniverCollabServiceManages Unit lifecycle, performs OT, and confirms continuous revisions
Database AdapterAtomically 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 SDKApplication
Unit collaboration stateUsers, tenants, hierarchy, and sharing relationships
OT, revisions, and snapshotsLogin, Sessions, and identity mapping
Collaboration Sessions, Rooms, and PresenceRoles, ACLs, and product policy
Collaboration Database AdaptersFiles, object storage, and product databases
Middleware and Event extension pointsLogging, audit, metrics, and external integrations
Client protocol EndpointsBusiness APIs and workflows such as document creation

Three general extension points

Extension pointProblems it solves
MiddlewareInspects or enriches Context, rejects requests, or records processing during an operation
EventObserves confirmed state changes for in-process derived state or non-critical follow-up work
Database AdapterSelects 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

  1. Run the quick start to verify the full path in two browsers.
  2. Read Module boundaries and relationships to understand why each package exists.
  3. Continue with Middleware and Events, Identity and authorization, or Database Adapters for your integration task.
  4. See Collaboration extension modules for History, Comments, Worktrees, and file exchange.