Support and interview sessions
Public support and interview state, targets, and session methods.
The SDK exposes support and interview session state so a host page can read the active Messenger surface and subscribe to state events. Session methods use the same command function, method namespace, and widget controller forms documented in JavaScript SDK.
CustomerAgentTarget
show(target) and toggle(target) accept an optional target. openEntry(entryId) is the direct
entry-id form.
type CustomerAgentTarget =
| { type: "entry"; entryId: string }
| { type: "home" }
| { type: "interview"; campaignId?: string; sessionId?: string }
| { type: "support" }| Target | Effect |
|---|---|
{ type: "support" } | Opens the support conversation entry. |
{ type: "interview" } | Opens the interview surface. |
{ type: "interview", sessionId } | Opens an interview session target. |
{ type: "entry", entryId } | Opens a specific conversation entry id. |
{ type: "home" } | Opens the panel home route. |
Support State
type CustomerAgentSupportState =
| { status: "idle" | "starting" | "refreshing" | "error"; error?: { message: string } }
| { status: "ready"; conversationId: string }| Method | Returns | Effect |
|---|---|---|
getSupportState() | CustomerAgentSupportState | null | Reads current support state. |
getSession() | Promise<{ conversationId: string } | null> | Ensures and returns the support conversation id. |
The widget controller returned by boot exposes non-null getSupportState() and
getSession() instance methods. The top-level singleton methods return null when no singleton is
initialized.
Interview State
type CustomerAgentInterviewState =
| { status: "idle" | "checking" | "unavailable" | "error"; error?: { message: string } }
| {
status: "available"
campaignId: string
title: string
body: string
startCta: string
laterCta: string
}
| { status: "active"; entryId: `interview/session/${string}`; sessionId: string; title?: string }
| {
status: "terminal"
sessionId: string
sessionStatus: "abandoned" | "aborted" | "completed" | "dismissed"
}| Status | Meaning |
|---|---|
idle | No active interview state. |
checking | Interview availability is being read. |
available | An interview invitation is available. |
active | An interview session is active. |
terminal | The interview session ended. |
unavailable | No interview invitation is available. |
error | The interview request failed. |
Interview Methods
| Method | Returns | Effect |
|---|---|---|
getInterviewState() | CustomerAgentInterviewState | null | Reads current interview state. |
getInterviewSession() | CustomerAgentInterviewSession | null | Reads the active interview session snapshot. |
ensureInvitation() | Promise<{ invitationId: string } | null> | Creates or returns the current invitation id. |
startInvitation(invitationId) | Promise<{ entryId: string; sessionId: string } | null> | Starts an interview session from an invitation. |
chooseInvitation(invitationId, choice) | Promise<void> | Records an invitation choice of "close" or "later". |
sendInterviewMessage(content) | Promise<void> | Sends a message in the active interview session. |
loadInterviewReward(sessionId?) | Promise<unknown> | Loads reward data for an interview session. |
ensureInvitation() rejects when no interview invitation is available. sendInterviewMessage()
rejects when no interview session is active. loadInterviewReward() rejects when no session id is
available.
CustomerAgentInterviewSession
type CustomerAgentInterviewSession = {
sessionId: string
status: "active" | "abandoned" | "aborted" | "completed" | "dismissed"
messages: Array<{
id: string
role: "assistant" | "user"
content: string
createdAt: string
}>
}