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 |
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 |
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:permissions
pnpm example:history
pnpm example:comments
pnpm example:worktree
pnpm example:exchangeThe examples cover only teaching and copyable assembly. They do not include file spaces, multi-type product editors, or a complete office suite. The exchange example intentionally uses an in-memory file/task store rather than a production file service.
quick-start intentionally keeps the Memory Adapter for the shortest possible setup. Every other
example stores its collaboration data in its own .data/collaboration.sqlite file so state survives
server restarts.
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.