Types
ActionResponse
The ActionResponse object represents an action triggered by the Halosight agent.
| Property | Type | Description |
|---|---|---|
name | string | The name identifier of the action |
label | string | The display label for the action |
parameters | Map<string, unknown> | Parameter map containing action data |
ActionResponseCallback
The ActionResponseCallback interface provides methods to respond to actions triggered by the Halosight agent.
| Method | Parameters | Description |
|---|---|---|
success | data?: unknown | Call this method to indicate the action was successful |
error | message: string, details?: unknown | Call this method to indicate the action failed with an error |
EmailParams
The EmailParams object contains the necessary information for sending an email.
| Property | Type | Description |
|---|---|---|
body | string | The plain text content of the email |
html | string | The HTML content of the email |
recipient | string | The email address of the recipient |
subject | string | The subject line of the email |
HalosightEmbed
Constructor Options
| Option | Type | Required | Description |
|---|---|---|---|
iframeId | string | Yes | The ID of the iframe element |
agentId | string | Yes | The ID of the Halosight agent |
type | string | Yes | The type of component to render (i.e. chat) |
getIframeElement | function | No | Custom function to retrieve the iframe element |
Methods
| Method | Parameters | Returns | Description |
|---|---|---|---|
onRegister | callback: () => void | HalosightEmbed | Register a callback for when the agent is initialized |
onGetAuth | callback: () => Promise<any> | HalosightEmbed | Register a callback that retrieves an access token from your backend. Must return a Promise resolving with the token. |
insertAgentArguments | args: Record<string, unknown> | HalosightEmbed | Pass arguments to the agent |
insertUiAttributes | attrs: Record<string, unknown> | HalosightEmbed | Customize the UI appearance |
onAction | callback: (action: ActionResponse, response: ActionResponseCallback) | HalosightEmbed | A callback that is invoked for ALL action types. |
onSendEmail | callback: (emailParams: EmailParams, response: ActionResponseCallback) | HalosightEmbed | Register a callback specifically for email actions |