SDK overview
Conversation clients and optional Messenger and React adapters.
A Customer Agent client owns support/interview sessions, messages, optimistic sends, recovery, polling, and business events. It can run without a DOM, React, a mounted Messenger, or subscribers. The built-in Messenger renders that client's state and sends user actions back to it.
| Surface | Entry | Responsibility |
|---|---|---|
CustomerAgentClient | @customer-agent/sdk | Conversation state, actions, identity/context, and lifecycle. |
CustomerAgentWidget | @customer-agent/sdk/widget | One mounted Messenger's UI state and controls. |
CustomerAgentProvider and hooks | @customer-agent/sdk/react | Supply and observe explicit instances in React. |
window.CustomerAgent | sdk.js | The same named factories for script integrations. |
The root factory has no global singleton or default export. Each client has its own state and lifecycle. UI and React consumers do not own that lifecycle: unmounting a widget or Provider does not shut down the client. A client can be attached to a Messenger later or used with a custom UI.
- ESM exports: factories, types, and migration.
- Headless client: business options, methods, state, and errors.
- Messenger options: presentation and mounting.
- Messenger methods: UI state, controls, and unmounting.
- React hooks: supplied instances, selectors, and events.
- Events: names and payloads.