API References
Set the embedded viewer user and configure Canvas collaboration rooms using the SDK.
Use viewer.collaboration to set the embedded viewer user and enable or disable Canvas collaboration configuration.
Collaboration commands are available after the viewer is mounted and Canvas is ready.
- 1Recommended Order:
- 21. Wait for
mount()andready(). - 32. Call
viewer.collaboration.setUser(...). - 43. Confirm
success === true. - 54. Call
viewer.collaboration.enable(...). - 65. Open or activate a document so Canvas can resolve the configured or default room.
Register user details before joining rooms:
setUser(...)sends the user details to Canvas and waits forsetUserResult. The Canvas result is not request-ID correlated, so the SDK rejects overlappingsetUser(...)calls for one viewer iframe.
Subscribe to user state events:
- Most applications can use the
setUser(...)promise directly. Use the event when your UI needs a shared collaboration log.
Configure and join document-scoped collaboration rooms. The roomId parameter is optional; if omitted, Canvas will fall back to a default room for the current document context:
enable(...)anddisable(...)config payloads returnvoidbecause Canvas does not currently emit a documentedcollaborationResultevent.
Send custom properties shape directly if needed:
- Prefer
enable(...)anddisable(...)for simple toggles.
Canvas joins the configured room internally after collaboration is enabled and document context is available.
If no room is supplied, Canvas uses a default room for the current document. Note that the current SDK does not expose direct room join, leave, create, delete, participant, or presenter commands.
- Canvas resolves room information from the viewer URL query string or collaboration config.
roomIdandcollaborationRoomIdare both supported as config keys.
Customize notification tooltips displayed during multi-user operations:
- Supported template parameters are Canvas-defined:
- -
{senderUsername}: Evaluates to the user's username. - -
{senderDisplayName}: Evaluates to the user's display name.
Typings and payload configuration models:
The SDK performs strict validation on collaboration inputs:
setUser(...)requires a non-empty string forusername.displayNameandemailmust be strings if provided.configure(...),enable(...), anddisable(...)require object payloads.enabledandcanCollaboratemust be booleans if provided.roomIdandcollaborationRoomIdmust be non-empty strings if provided.collaborationTooltip.durationmust be finite if provided.collaborationTooltip.positionmust map to[number | "center", number]if provided.
Complete integration code setup for Vanilla HTML/JS environments:
Complete React Component implementation details:
Ensure the SDK functions client-side inside client component contexts:
Complete Angular component implementation details:
Broker message mapping for collaboration surface:
viewer.collaboration.setUser(...)maps tosetUser/setUserResult.viewer.collaboration.on("setUserResult", ...)listens tosetUserResult.viewer.collaboration.configure(...)maps tocollaboration.viewer.collaboration.enable(...)maps tocollaborationwithenabled: true.viewer.collaboration.disable(...)maps tocollaborationwithenabled: false.
