Customer Agent

Script entry

Instance factories exposed by window.CustomerAgent.

The module script (type="module") registers window.CustomerAgent as a namespace with the same named core exports and Messenger mounting factory as the widget ESM entry. It is an object, not a command function.

<script type="module" src="https://your-cdn.example/customer-agent/sdk.js"></script>
<script type="module">
  const { createClient, mountWidget } = window.CustomerAgent
  const client = createClient({ appId: "your-app" })
  await client.boot()
  const widget = await mountWidget({ client })
</script>

Load the module script before accessing the namespace. Its core is shared with the ESM entries; the build does not include a second standalone runtime. For an asynchronously inserted script, its load event marks namespace availability. Importing the namespace does not start a client or mount UI.

MemberSignature / valueEffect
createClient(options: CustomerAgentClientOptions) => CustomerAgentClientCreates a client without requests or UI.
mountWidget(options: CustomerAgentWidgetOptions) => Promise<CustomerAgentWidget>Attaches the Messenger to the supplied client.
Core constants and versionSame values as the root ESM entryTyped event, invitation, message, and version identifiers.

Client lifecycle and actions are described in Headless client. UI controls and unmounting are described in Messenger methods.

The script has no command queue, string-command API, or data-attribute auto-boot. Serve the full build directory: the script loads the widget entry and its companion assets when mounting is requested. It does not require a globally installed React package.