Collaboration

Plugins Info

Several people can edit the same presentation and see one another's changes as they occur. Complete collaboration integration for the backend, authentication, permissions, and storage first, then configure the license.

Configure and load a document

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

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

TypeScript
import '@univerjs-pro/slides/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().loadSlideAsync('your-document-id')if (!document) throw new Error('Document could not be loaded')

Use the same ID when reopening or sharing the document. Never create a local blank document in place of the server document.

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

Removal of built-in URL loading for collaborative documents

Note

Version 1.2.0 removed built-in URL loading for collaborative documents. The unit and type URL parameters are no longer read automatically when a collaborative document loads.

If the application relies on this behavior, a custom plugin can restore it.

Integrate the custom plugin

Copy the four files below into the project, preserving the following 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 the 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 the plugin is registered, it loads the document, so calling loadSlideAsync() for the same document is unnecessary. If the application already loads documents through the Facade, keep the approach from the previous section and handle URLs as the application requires.

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, then check the other session. Confirm that the content survives page reloads, reconnections, and a service restart. Use a viewer account and an account without permission to confirm that the server rejects forbidden reads and writes.

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

How is this guide?

© 2026 DreamNum Co., Ltd.