Collaboration

Plugins Info

Let multiple users edit the same board and see each other's changes. Complete collaboration integration for the backend, authentication, permissions, and storage, then configure the license.

Configure and load a document

Add Collaboration Client configuration to your existing Boards editor using the Collaboration Quick Start. That example uses Sheets; your backend must create and persist a Boards document and return its ID to the browser.

Set the current user before loading the document. See Collaboration integration.

TypeScript
import '@univerjs-pro/boards/facade'import { UserManagerService } from '@univerjs/core'import '@univerjs-pro/collaboration-client/facade'univer.__getInjector().get(UserManagerService).setCurrentUser({ userID, name, avatar })const document = await univerAPI.getCollaboration().loadBoardAsync('your-document-id')if (!document) throw new Error('Document could not be loaded')

Use the same ID when reopening or sharing the document. Do not create a local blank document instead of loading the server document.

Use synchronization status, retries, and conflict recovery to build saving indicators and protect unacknowledged edits before reloading.

Removal of built-in URL loading for collaborative documents

Note

Starting with version 1.2.0, Univer has removed built-in URL loading for collaborative documents. It no longer automatically reads the unit and type URL parameters to load a collaborative document.

If your application relies on this behavior, you can restore it with a custom plugin.

Integrate the custom plugin

Copy the four files below into your project using this directory structure:

text
custom-url-load/├── plugin.ts├── controllers/│   └── data-loader.controller.ts└── services/    ├── url.service.ts    └── web-url.service.ts

After initializing the editor and collaboration plugins, set the current user before registering CustomUrlLoadPlugin.

TypeScript
import { UserManagerService } from '@univerjs/core'import { CustomUrlLoadPlugin } from './custom-url-load/plugin'univer.__getInjector().get(UserManagerService).setCurrentUser({ userID, name, avatar })univer.registerPlugin(CustomUrlLoadPlugin)

Once registered, the plugin loads the document, so you do not need to call loadBoardAsync() for the same document. If your application already loads documents through the Facade, you can keep the approach in the previous section and handle URLs according to your application’s needs.

Complete plugin code

TypeScript
import { UniverCollaborationClientPlugin } from '@univerjs-pro/collaboration-client'import { DependentOn, Inject, Injector, Plugin } from '@univerjs/core'import { CollaborationDataLoaderController } from './controllers/data-loader.controller'import { IURLService } from './services/url.service'import { WebURLService } from './services/web-url.service'@DependentOn(UniverCollaborationClientPlugin)export class CustomUrlLoadPlugin extends Plugin {  static override pluginName = 'CUSTOM_URL_LOAD_PLUGIN'  constructor(    _config: undefined,    @Inject(Injector) protected override readonly _injector: Injector  ) {    super()  }  override onStarting(): void {    this._injector.add([IURLService, { useClass: WebURLService }])    this._injector.add([CollaborationDataLoaderController])    this.disposeWithMe(this._injector.get(IURLService))    this.disposeWithMe(this._injector.get(CollaborationDataLoaderController))  }}

Verify synchronization and permissions

Open the same ID in two independent browser sessions. Edit text or move an element in one session and check the other. Verify that content survives page reloads, reconnections, and a service restart. Use viewer and unauthorized accounts to verify that the server rejects forbidden writes and reads.

Edit history and Import and export require separate configuration; collaboration does not enable them automatically.

How is this guide?

© 2026 DreamNum Co., Ltd.