Script entry
Browser global exposed by the Customer Agent script SDK.
The script entry is the browser-global version of the SDK. It exposes one global,
window.CustomerAgent, which is both a command function and a method namespace.
window.CustomerAgent: CustomerAgentGlobalCommand Forms
| Form | Shape | Return |
|---|---|---|
| Command call | window.CustomerAgent(command, ...args) | Command-specific return value. |
| Method call | window.CustomerAgent.boot(options) | Method-specific return value. |
The command names and method names match the JavaScript SDK reference.
Script Attributes
When the script element has data-app-id, the SDK boots the Messenger from script attributes.
<script async src="https://cdn.example.com/customer-agent/v1/sdk.js" data-app-id="app_123"></script>| Attribute | Type | Effect |
|---|---|---|
data-app-id | string | Sets CustomerAgentOptions.app_id. |
data-open | "true" | "false" | Sets open_on_init; only "true" opens. |
data-position | "bottom-right" | "bottom-left" | Sets default launcher position. |
Global API
window.CustomerAgent supports the same command form and methods as the ESM SDK.
| API | Reference |
|---|---|
| Methods | JavaScript SDK |
| Options | Options |
| Events | Events |