@univerjs-pro/collaboration-client
Client-side collaboration plugin for Web SDK.
TypeScript
import type { IUniverCollaborationClientConfig } from '@univerjs-pro/collaboration-client'import { UniverCollaborationClientPlugin } from '@univerjs-pro/collaboration-client'import { BrowserCollaborationSocketService } from '@univerjs-pro/collaboration-client-ui'const config: IUniverCollaborationClientConfig = { socketService: BrowserCollaborationSocketService,}univer.registerPlugin(UniverCollaborationClientPlugin, config)socketService is required. Browser clients can use BrowserCollaborationSocketService; other hosts must provide their own ICollaborationSocketService implementation.
Entry Points
- Facade:
@univerjs-pro/collaboration-client/facade - Locale:
@univerjs-pro/collaboration-client/locale/*
The Facade entry exposes host-specific loaders for Sheets, Docs, Bases, Slides, Boards, and PDFs, including loadPdfAsync(unitId, context?).
IUniverCollaborationClientConfig
TypeScript
import type { Ctor, DependencyOverride } from '@univerjs/core'import type { ICollaborationSocketService } from '../services/socket/collaboration-socket.service'export interface IUniverCollaborationClientConfig { /** * Which socket should the plugin use to build connections to the collaborative engine. * For normal cases, you should use `BrowserCollaborationSocketService` from the `collaboration-client-ui` plugin. */ socketService: Ctor<ICollaborationSocketService> /** * If the plugin should enable collaborative editing. Which means the client will exchange edits with * the collaboration server. It this is set to false, the client will simply load data from the server. * * @default true */ enableCollaboration?: boolean /** * If offline editing is enabled. * @default false */ enableOfflineEditing?: boolean enableSingleActiveInstanceLock?: boolean enableAuthServer?: boolean /** * Override internal modules with custom implementations. */ override?: DependencyOverride sendChangesetTimeout?: number snapshotServerUrl?: string collabSubmitChangesetUrl?: string collabWebSocketUrl?: string /** * The URL of the endpoint for getting the websocket session ticket. */ wsSessionTicketUrl?: string loginUrlKey?: string retryConnectingInterval?: number authzUrl?: string /** * The URL of the endpoint for downloading files. * @default 'location.origin' */ downloadEndpointUrl?: string uploadFileServerUrl?: string signUrlServerUrl?: string /** * The URL of the endpoint for starting formula limit. */ startFormulaLimitUrl?: string /** * The URL of the endpoint for getting formula limit status. */ getFormulaLimitStatusUrl?: string /** * The URL of the endpoint for releasing formula limit. */ releaseFormulaLimitUrl?: string /** * The socket connection custom headers. */ customHeaders?: Record<string, string>}How is this guide?