The widget loaded, verified its token, and rendered.
Which widget kind fired.
The consult the widget is bound to. EMPTY for agent: that session is
scoped to a patient, not to a consult.
Async: the patient accepted the consent prompt.
The consult is waiting for a physician (async: consented but no capacity yet; telehealth: patient is in the waiting room).
A physician took the consult.
OptionalphysicianName?: stringDisplay name to show the patient, when available.
Async: a new message appeared on the thread (any author). Mirrors what the widget just rendered — useful for host-page unread badges.
The message, without fresh attachment URLs (the widget handles those).
Telehealth: the patient entered the live call.
Telehealth: the call ended (the rating step may follow).
The patient submitted a rating.
Optionalstars?: numberThe overall star rating, if stars were given.
The consult reached a terminal state (including a declined consent,
which surfaces as closed with closedReason: 'declined').
OptionalclosedReason?: AsyncClosedReasonAsync consults: why it closed.
The session token expired. The widget freezes (read-only) until the
host mints a fresh token server-side and calls refresh(token).
Something went wrong (invalid token, disallowed origin, network…).
Optionalcode?: stringMachine-readable code when the failure maps to an API error code.
Human-readable description for logging.
Per-event
detailpayloads: what each DOMCustomEvent'sdetail(and each postMessage envelope'sdata) contains.Events by surface:
ready,closed,expired,error,rated.consented,queued,assigned,message.joined,ended(plusqueuedwhile in the waiting room andassignedwhen a physician picks up).