ApolloMessagingClient is the browser-safe client for end-user messaging. It
authenticates with your publishable key, exchanging it for a short-lived access
token internally — the agent comes from the key, never from request bodies.
async, fully typed, and throw typed
errors on failure. Request and response
models are exported under the Apollo namespace.
Send a message
Omitthread_id to start a new conversation, or pass it to continue one.
cards. Each card holds the same entity in two
self-contained representations, so you pick what fits your stack: a
ready-to-render JSX string for React, or structured JSON for any other
framework — see Cards for the full shape.
agent_variables:
Stream a message
streamMessage returns the reply as an async-iterable stream of Server-Sent
Events — token deltas while the agent works, then the complete message:
seq you saw:
Rerun an interaction
Regenerate a previous interaction — with the original or edited text — on a new thread branched from the original:Read a conversation
Welcome message and follow-up suggestions
Channels (WhatsApp and SMS)
Start an outbound conversation on a channel — pass'whatsapp' or 'sms':
Method reference
Every method also accepts a final
requestOptions argument
(timeoutInSeconds, maxRetries, abortSignal, extra headers) — see
Best practices.