Collaboration

Plugins Info

With collaboration enabled, several users can edit the same board and see each other's changes. Follow collaboration integration to set up the backend, authentication, permissions, and storage, then configure the license.

Configure and load a document

Use the Collaboration Quick Start to add Collaboration Client configuration to an existing Boards editor. That example uses Sheets, so the backend must still create and persist a Boards document and return its ID to the browser.

Set the current user before loading the document. Collaboration integration describes the procedure.

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')

Reopening or sharing the document uses the same ID. Do not create a local blank document in place of the server document.

For saving indicators and for protecting edits that the server has not yet acknowledged before a reload, see synchronization status, retries, and conflict recovery.

Removal of built-in URL loading for collaborative documents

Note

Starting with version 1.2.0, Univer no longer loads collaborative documents from the URL. It no longer reads the unit and type URL parameters automatically.

If the application depends on that behavior, a custom plugin can restore it.

Integrate the custom plugin

Copy the four files below into the project and keep the following directory structure:

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

Initialize the editor and collaboration plugins, set the current user, and then register 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 handles loading, so loadBoardAsync() is not required for the same document. If the application already loads documents through the Facade, keep the approach from the previous section and handle URLs according to the application's requirements.

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 separate browser sessions. Edit text or move an element in one session, then check the other. Confirm that content survives page reloads, reconnections, and a service restart. Use viewer and unauthorized accounts to confirm that the server rejects writes and reads that their permissions forbid.

Collaboration does not enable Edit history or Import and export; each requires separate configuration.

How is this guide?

© 2026 DreamNum Co., Ltd.