Package Overview
Understand the public Collaboration SDK packages for Core, History, Thread Comment, Worktree, File, and Office Exchange.
This page explains how to select packages from the Collaboration SDK. Start with Core Collaboration, then add the extension modules that the product requires. Installing every package is not necessary.
The server packages for Database Adapters, File, and Office Exchange are open source under Apache-2.0, and their source code is published in univer-collaboration-sdk-community. These packages use the same package prefix and version as every other package, and they are installed in the same way.
Core collaboration
Core Collaboration provides the main path: browser collaboration, server protocol handling, OT, revisions, and persistence.
| Runtime | Package | What it does |
|---|---|---|
| Browser | @univerjs-pro/collaboration | Registers foundational browser collaboration capabilities |
| Browser | @univerjs-pro/collaboration-client | Loads Units, submits changesets, and maintains realtime synchronization |
| Browser | @univerjs-pro/collaboration-client-ui | Provides collaboration status UI and styles |
| Server | @univerjs-pro/collaboration-transport-node | Receives Node.js HTTP and WebSocket traffic |
| Server | @univerjs-pro/collaboration-endpoint | Implements the Client protocol, Sessions, Rooms, and Presence |
| Server | @univerjs-pro/collaboration-service | Manages Units, OT, revisions, and core Service APIs |
| Database | @univerjs-pro/collaboration-database-memory | In-process storage for tests, examples, and temporary development |
| Database | @univerjs-pro/collaboration-database-sqlite | SQLite persistence for development, testing, local, and small-scale use |
| Database | @univerjs-pro/collaboration-database-postgres | PostgreSQL persistence shared by several nodes |
| Database | @univerjs-pro/collaboration-database-postgres-s3 | Stores Sheet blocks in S3 to reduce PostgreSQL database and backup size |
| Multi-node | @univerjs-pro/collaboration-cluster-redis | Redis pub/sub adapter and session ticket store for multi-node deployment |
A Core Server requires Transport, Endpoint, Service, and one Database Adapter. Memory, SQLite, PostgreSQL, and PostgreSQL + S3 implement the same Adapter contract, so an application normally selects one of them. A multi-node deployment additionally requires a pub/sub adapter and a shared session ticket store. The Endpoint defines both contracts (IPubSubAdapter, ISessionTicketStore), and the SDK provides a Redis implementation.
History
History builds a version-history index from the Unit creation and changeset commit Events that Core emits.
| Runtime | Package | What it does |
|---|---|---|
| Browser | Reuses Core Client/UI | Displays and reads history entries |
| Server | @univerjs-pro/collaboration-history-service | Builds and queries the history index |
| Server | @univerjs-pro/collaboration-history-endpoint | Provides History protocol capabilities to the Client |
| Database | @univerjs-pro/collaboration-history-database-memory | In-process storage for the History index |
| Database | @univerjs-pro/collaboration-history-database-sqlite | SQLite persistence for the History index |
| Database | @univerjs-pro/collaboration-history-database-postgres | Stores the History index in PostgreSQL |
History data is a derived index and can always be rebuilt. Core changesets remain authoritative for Unit content.
Thread Comment
Thread Comment manages comment bodies, replies, and resolution status.
| Runtime | Package | What it does |
|---|---|---|
| Browser | Reuses Core Collaboration packages | Uses Comment Client and UI capabilities |
| Server | @univerjs-pro/collaboration-comment-service | Manages comment operations and the commentCommitted Event |
| Server | @univerjs-pro/collaboration-comment-endpoint | Provides the comment protocol and publishes updates through Unit Rooms |
| Database | @univerjs-pro/collaboration-comment-database-memory | In-process comment storage |
| Database | @univerjs-pro/collaboration-comment-database-sqlite | SQLite comment persistence |
| Database | @univerjs-pro/collaboration-comment-database-postgres | Stores comments and replies in PostgreSQL |
The Comment Adapter stores comment data. Anchors that move with content remain part of Core snapshots and changesets.
Worktree
Worktree provides isolated drafts, status transitions, and per-Unit merge.
| Runtime | Package | What it does |
|---|---|---|
| Browser | @univerjs-pro/collaboration-worktree-client | Connects Worktree draft, status, and merge capabilities |
| Server | @univerjs-pro/collaboration-worktree-service | Manages draft changesets, status, and merge |
| Server | @univerjs-pro/collaboration-worktree-endpoint | Provides protocol capabilities to Worktree Client |
| Database | @univerjs-pro/collaboration-worktree-database-memory | In-process Worktree storage |
| Database | @univerjs-pro/collaboration-worktree-database-sqlite | SQLite Worktree persistence |
| Database | @univerjs-pro/collaboration-worktree-database-postgres | Persists Worktree drafts in PostgreSQL |
Worktree Service ultimately merges into the trunk through Core Service, so Middleware must be configured at both Service boundaries.
File
File stores the binary files that Univer clients upload: images and attachments inserted into a Unit, together with the source and result files of an import or export. Unit data records only the file ID.
| Runtime | Package | What it does |
|---|---|---|
| Browser | Reuses the Core Collaboration Client | Uploads images and attachments and resolves file IDs to URLs |
| Server | @univerjs-pro/collaboration-file-service | Applies ownership rules, Middleware, and temporary-file cleanup |
| Server | @univerjs-pro/collaboration-file-endpoint | Provides the upload, sign-url, and download routes |
| Database | @univerjs-pro/collaboration-file-memory | In-process storage for metadata and content |
| Database | @univerjs-pro/collaboration-file-database-sqlite | SQLite persistence for file metadata |
| Database | @univerjs-pro/collaboration-file-database-postgres | PostgreSQL persistence for file metadata |
| Storage | @univerjs-pro/collaboration-file-blob-local | Stores file content in a local directory |
| Storage | @univerjs-pro/collaboration-file-blob-s3 | Stores file content in S3-compatible object storage, with signed direct links |
Metadata and content are two independent contracts, so each can use the storage that the application already provides. Metadata can reside in the database while content resides in object storage.
Office Exchange
Office Exchange imports Office files into collaborative Units and exports Units as files. File stores the source and result files.
| Runtime | Package | What it does |
|---|---|---|
| Browser | @univerjs-pro/exchange-client | Provides foundational browser file-exchange capabilities |
| Browser | @univerjs-pro/sheets-exchange-client | Provides Sheet file import and export |
| Server | @univerjs-pro/collaboration-exchange-service | Manages import and export tasks, Middleware, and Unit creation and reads |
| Server | @univerjs-pro/collaboration-exchange-endpoint | Provides the import, export, and task routes |
| Server | @univerjs-pro/exchange-node | Converts Office files and Univer data in Node.js |
Exchange Service creates and reads Units through Core Service and reads and writes files through File Service, so it must be assembled together with Core and File.
Selection rules
- Start with the Core packages from Quick Start.
- Choose one Core Database Adapter for the application.
- For a multi-node deployment, add the Redis pub/sub adapter and session ticket store.
- Install only the extension-module packages that the product uses.
- If the product requires images, attachments, or import and export, assemble File first and add Office Exchange only when it is needed.
- Create a separate Adapter for each module even when several modules share one database.
See Collaboration extension modules for the relationships between modules, and the examples index for runnable assemblies.
How is this guide?