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.
| Member | Signature / value | Effect |
|---|---|---|
createClient | (options: CustomerAgentClientOptions) => CustomerAgentClient | Creates a client without requests or UI. |
mountWidget | (options: CustomerAgentWidgetOptions) => Promise<CustomerAgentWidget> | Attaches the Messenger to the supplied client. |
| Core constants and version | Same values as the root ESM entry | Typed 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.