Message API/docs/components/collaboration/setup

User Set

Establish participant identity for attribution and synchronization.

Identity Setup (User Set)

Collaboration requires identifying each participant to ensure that annotations and measurements are attributed correctly.

The host application sends user details via a `setUser` message once the session is ready.

Host Sends

User Set

Send current user information to the session.

javascript
// Define user information
const userPayload = {
  username: "jdoe_99",
  displayName: "John Doe",
  email: "john.doe@example.com"
};

// Send to canvas
viewer.postMessage({
  type: "setUser",
  payload: userPayload
}, viewerOrigin);