License
Collaboration SDK uses the License to decide collaborative editing connections, authorized domains, collaboration nodes and document types.
UniverCollabService loads the License during construction, and Endpoints and Worktrees share that instance. Configure the License as described in License; without one, the SDK runs on the free tier. If verification fails, the constructor throws a CollabError (LICENSE_INVALID or LICENSE_POLICY_INVALID), and the service does not start.
What the License decides
| Item | Checked at | Beyond the limit |
|---|---|---|
| Collaborative editing connections | Endpoint, on receiving submissions | Edits from new connections remain in the browser and are retried |
| Authorized domains | Endpoint, when connecting and on submissions | The browser's collaboration session goes offline |
| Collaboration nodes | Endpoint | Nodes beyond the limit go offline after a grace period |
| Document types | Service, on Unit creation and edit submission | Creation and submissions are rejected; existing documents stay viewable |
Collaborative editing connections
The allowance counts only connections that are actively editing. A collaboration connection occupies a slot after its first successful submission and releases it when the connection closes, or 120 seconds after its last successful submission. Connections that open a document only for viewing can join at any time. Edits inside a Worktree count against the same slot pool as edits on the trunk.
When every slot is occupied, edits from a new connection remain in the browser, and Web SDK resends them with backoff until a slot becomes available. Connections that already hold a slot continue editing. The browser's CollaborationChangesetResend reports these resends with reason: 'license_editing_connections_exceeded'.
Authorized domains
When Web SDK opens a collaboration connection or submits edits, the Endpoint compares the page's domain with the authorized domains in the License. A domain outside that list receives 403; the browser's collaboration session then goes offline and displays the reason. The session retries when the user reconnects or opens another document.
Collaboration nodes
A single-node License, including the free tier, runs one collaboration node. Passing pubSub to the Endpoint makes the constructor throw LICENSE_POLICY_INVALID.
A multi-node License defines a node limit. When the number of running nodes exceeds that limit, the newest nodes enter a grace period with escalating warnings and then go offline. New connections receive 503, and existing connections close. Nodes within the limit continue serving traffic. If the node count drops back within the limit during the grace period, the extra nodes return to normal. A node that has gone offline is counted as a new node again after its process restarts. For multi-node deployments, see Deployment.
Document types
The License lists the document types available for collaboration. Creating a Unit of any other type throws LICENSE_UNIT_TYPE_REJECTED, and the submitted edits are rejected. CollaborationConflict in the browser reports reason as license_unit_type_rejected. Existing documents remain viewable.
Observe the state
// ServicecollabService.license.status // License status: 'not_configured' | 'expired' | 'valid'collabService.license.editingConnectionsLimit // editing connection limit: number | null; null means unlimitedcollabService.license.nodesLimit // node limit: number | null; null means unlimitedcollabService.license.domains // authorized domains: string[]collabService.license.expiresAt // expiry time: ISO string | null; null when not configuredcollabService.license.update({ license, licenseKey }) // replace the License; throws and keeps the current one if verification fails// Endpointendpoint.license.editingConnections.limit // slot limit: number | null; null means unlimitedendpoint.license.editingConnections.used // slots in use: number | null; null when limit is unlimitedendpoint.license.editingConnections.remaining // slots left: number | null; null means unlimitedendpoint.license.editingConnections.has(memberID) // whether this member holds a slot: boolean; false when limit is unlimitedendpoint.license.nodes.limit // node limit: number | null; null means unlimitedendpoint.license.nodes.status // this node's status: 'normal' | 'exceeded' | 'exceeded-warning' | 'exceeded-offlineSoon' | 'exceeded-offline'// Eventsendpoint.license.on('editingConnectionsChanged', ({ change, memberIDs, used, limit }) => {}) // slots were taken or given back: change is 'acquired' | 'released', used is the value after the change; not fired when limit is unlimitedendpoint.license.on('editingConnectionsExceeded', ({ memberID, userID, unitID, used, limit }) => {}) // slots are full and a new connection's submission was held backendpoint.license.on('nodesStatusChanged', ({ status, previousStatus, limit, reason }) => {}) // this node's status changed; reason is set only when it goes offlinenodesStatusChanged fires once for each status change of this node. When status becomes exceeded-offline, the node has stopped accepting connections; remove it from the load balancer or raise an alert.
How is this guide?