English | 简体中文
This repository contains only runnable examples for the Univer Collaboration SDK. The public documentation is maintained on office.univer.ai.
- Follow the documentation site's Quick Start and use two browsers to verify the HTTP, WebSocket, and OT path.
- Choose an example below for the capability you want to explore, then compare its minimal frontend and backend source.
- Use the Collaboration documentation for architecture, middleware, identity, persistence, and production guidance.
All examples use the same minimal web/main.ts + server/main.ts structure and can run
independently. Start with quick-start to establish the main
collaboration path, then choose another example for the capability you want to explore.
| Example | What it demonstrates |
|---|---|
quick-start |
Minimal real-time Sheet collaboration path |
database-adapter |
SQLite persistence and restart recovery |
all-unit |
Five fixed Unit types, sidebar switching, and SQLite persistence |
permissions |
Trusted identity and server-side permission boundaries |
history |
Version history service and browser entry |
comments |
Thread Comment service and frontend entry |
worktree |
Complete draft, ready, reopen, and merge lifecycle |
exchange |
Server-side Sheet import/export with exchange-node |
multi-node |
File creation and listing with Nginx consistent hashing by unitID across two collaboration nodes |
Prepare Node.js 24 or later and pnpm:
pnpm install
pnpm example:quick-startThe other examples use the same command form:
pnpm example:database-adapter
pnpm example:all-unit
pnpm example:permissions
pnpm example:history
pnpm example:comments
pnpm example:worktree
pnpm example:exchange
pnpm example:multi-nodeThe examples cover only teaching and copyable assembly. They do not include file spaces or a complete office suite. The exchange example intentionally uses an in-memory file/task store rather than a production file service.
quick-start uses the Memory Adapter to keep setup minimal. The other single-node examples store
collaboration data in their own .data/collaboration.sqlite file so state survives server restarts.
multi-node requires Docker Compose and builds inside its containers. Its shared SQLite database
lives in a Docker volume.
Fixed users, demo authorization, and local secrets are for teaching only and are not production configuration. Before integrating in production, read Identity and authorization, Middleware and Events, and Database Adapters.