Customer Agent

Events

Public namespaced events emitted by the Customer Agent SDK.

Subscribe

on<TEventName extends CustomerAgentEventName>(
  eventName: TEventName,
  handler: (event: CustomerAgentEventMap[TEventName]) => void
): () => void

The return value unsubscribes the handler.

Base Payload

Every event includes these fields.

FieldTypeMeaning
typeCustomerAgentEventNameEvent name.
appIdstringCustomer Agent app id.
widgetIdstringRuntime instance id.
timestampstringISO timestamp.

Conversation Payload

Conversation and message events include conversation metadata when available.

FieldTypeMeaning
conversationIdstringConversation identifier.
conversationType"support" | "interview" | stringConversation product surface.
entryIdstringConversation entry id.
supportConversationIdstringSupport conversation id.
interviewSessionIdstringInterview session id.

Event Names

CUSTOMER_AGENT_EVENTS exposes these stable string values.

EventAdditional payloadEffect
widget.readyNoneMessenger UI is ready.
widget.openedNoneMessenger opened.
widget.closedNoneMessenger closed.
widget.expandedNoneMessenger expanded.
widget.collapsedNoneMessenger collapsed.
conversation.createdConversation payloadA support or interview conversation was created.
transcript.downloadedConversation type, messageCount, optional conversation payloadA support or interview transcript was downloaded.
support.state_changedsupport: CustomerAgentSupportStateSupport state changed.
support.handoff_requestedOptional conversation payloadHuman handoff was requested.
support.feedback_submittedOptional conversation payload, optional messageIdMessage feedback was submitted.
support.bug_reportedOptional conversation payloadBug report was submitted.
interview.state_changedinterview: CustomerAgentInterviewStateInterview state changed.
interview.availableAvailable interview state fieldsAn interview invitation is available.
interview.invitation_showncampaignId, entryId, invitationIdAn interview invitation was shown.
interview.invitation_latercampaignId, entryId, invitationIdThe invitation was deferred.
interview.invitation_closedcampaignId, entryId, invitationIdThe invitation was closed.
interview.session_startedConversation payloadAn interview session started.
interview.session_completedConversation payload, optional statusAn interview session completed.
interview.reward_updatedOptional conversation payload, optional rewardInterview reward data changed.
message.sentOptional conversation payload, messageId, roleUser or assistant message submitted.
message.send_failedOptional conversation payload, optional messageId, roleMessage request failed before completion.
message.startedConversation payload, optional messageId, roleMessage response started.
message.completedConversation payload, messageId, role, optional assistantAuthorMessage response completed.
message.failedOptional conversation payload, optional messageId, roleMessage response failed.
message.retryOptional conversation payload, optional messageId, roleMessage retry requested.
errormessageSDK error reported.

role is "assistant" or "user". assistantAuthor, when present, is "llm" or "human". transcript.downloaded always includes conversationType, which is "support" for support transcripts and "interview" for interview transcripts.

Handoff, feedback, bug report, and retry are public event names and are emitted only when the matching Messenger behavior exists. The declared message payload type keeps role as "assistant" | "user"; current response lifecycle events are emitted for assistant responses.

Event Types

TypeShape
CustomerAgentEventNameUnion of public event names.
CustomerAgentEventMapMap from event name to payload type.

On this page