# Collaboration SDK overview

> Understand what the Univer Collaboration SDK solves, how its modules compose, its extension points, and the product boundaries your application retains.

- Human documentation: [https://office.univer.ai/collaboration/overview](https://office.univer.ai/collaboration/overview)

- Agent Markdown: [https://office.univer.ai/collaboration/overview.md](https://office.univer.ai/collaboration/overview.md)

- Language: `en`

- Source file: `content/docs/collaboration/overview.mdx`

- Upstream source: [https://github.com/dream-num/office.univer.ai/blob/main/content/docs/collaboration/overview.mdx](https://github.com/dream-num/office.univer.ai/blob/main/content/docs/collaboration/overview.mdx)

---

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.

> **It is not a complete document product**
>
> The Collaboration SDK provides the collaboration core. It does not provide users, roles,
> hierarchy, sharing, file spaces, or business workflows. Your application still owns those product
> capabilities and data models.

## 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

```mermaid
flowchart LR
    ClientA["Client A<br/>Runtime SDK + Collaboration Client"]
    ClientB["Client B<br/>Runtime SDK + Collaboration Client"]

    subgraph Server["Collaboration Server"]
        direction LR
        Transport["Node Transport"]
        Endpoint["Collaboration Endpoint"]
        Service["Collaboration Service"]
        Adapter["Database Adapter"]

        Transport --> Endpoint --> Service --> Adapter
    end

    Database[(Database)]

    ClientA -->|"HTTP / WebSocket"| Transport
    ClientB -->|"HTTP / WebSocket"| Transport
    Adapter --> Database
```

| 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](https://office.univer.ai/collaboration/middleware-and-events.md) for their execution boundaries.

## Where to start

1. Run the [quick start](https://office.univer.ai/collaboration/quick-start.md) to verify the full path in two browsers.
2. Read [Module boundaries and relationships](https://office.univer.ai/collaboration/modules.md) to understand why each
   package exists.
3. Continue with [Middleware and Events](https://office.univer.ai/collaboration/middleware-and-events.md),
   [Identity and authorization](https://office.univer.ai/collaboration/identity-and-authorization.md), or
   [Database Adapters](https://office.univer.ai/collaboration/database-adapters.md) for your integration task.
4. See [Collaboration extension modules](https://office.univer.ai/collaboration/extensions.md) for History, Comments,
   Worktrees, and file exchange.
