@docx-editor.dev/pro/collaboration/webrtc

Peer-to-peer convenience wrapper: one owned y-webrtc room over the full-document collaboration replica.

Functions (3)

createCollaborationRoomIdfunctionSource ↗

Create a cryptographically strong room identifier. It is not an authorization token.

declare function createCollaborationRoomId(): string;

createWebrtcCollaborationfunctionSource ↗

Create one owned y-webrtc room and provider-neutral collaboration session.

declare function createWebrtcCollaboration(options: CreateWebrtcCollaborationOptions): Promise<WebrtcCollaborationHandle>;

validateRoomIdfunctionSource ↗

Validate and normalize a room identifier from a host interface.

declare function validateRoomId(value: string): string;

Interfaces (2)

CreateWebrtcCollaborationOptionsinterfaceSource ↗

Options for the owned WebRTC collaboration convenience wrapper.

interface CreateWebrtcCollaborationOptions
MemberTypeSummary
bootstrapCollaborationBootstrapCreate the room from a document, or join one that peers already hold.
iceServers?readonly RTCIceServer[]STUN and TURN servers for the peer connections. Use TURN across restrictive networks.
identityCollaborationIdentityWho this participant is, as peers see them.
offlineEditing?booleanAdmit local edits while the transport is `disconnected`. Buffered updates merge on reconnect. On by default; pass `false` to pause editing while disconnected. See [CreateDocumentCollaborationOptions.offlineEditing](CreateDocumentCollaborationOptions.offlineEditing).
password?stringSignaling encryption secret for `y-webrtc`.
roomIdstringThe room to join: a `createCollaborationRoomId` value every participant shares.
signaling?readonly string[]Signaling server URLs that introduce peers to each other.

WebrtcCollaborationHandleinterfaceSource ↗

Owned WebRTC provider and provider-neutral collaboration resources.

interface WebrtcCollaborationHandle extends DocumentCollaborationHandle
MemberTypeSummary
providerWebrtcProviderThe owned `y-webrtc` provider. `destroy()` destroys it.
subscribeUnsyncedChangesCall `listener` when `unsyncedChanges()` changes. Returns the unsubscribe function.
unsyncedChangesLocal changes no peer has received: made while no peer was connected, and not synced since. A WebRTC room has no server, so these changes exist only in this browser.
ydocY.DocThe room's shared Yjs document, owned by this handle.

Variables (1)

DEMO_SIGNALING_ENDPOINTSconstSource ↗

Public demo signaling endpoints. Use these endpoints for demos only.

Production deployments must pass their own signaling URLs and TURN servers. WebRTC peers cannot connect across many networks without TURN.

DEMO_SIGNALING_ENDPOINTS: readonly string[]