Skip to main content

Types

ActionResponse

The ActionResponse object represents an action triggered by the Halosight agent.

PropertyTypeDescription
namestringThe name identifier of the action
labelstringThe display label for the action
parametersMap<string, unknown>Parameter map containing action data

ActionResponseCallback

The ActionResponseCallback interface provides methods to respond to actions triggered by the Halosight agent.

MethodParametersDescription
successdata?: unknownCall this method to indicate the action was successful
errormessage: string, details?: unknownCall this method to indicate the action failed with an error

EmailParams

The EmailParams object contains the necessary information for sending an email.

PropertyTypeDescription
bodystringThe plain text content of the email
htmlstringThe HTML content of the email
recipientstringThe email address of the recipient
subjectstringThe subject line of the email

HalosightEmbed

Constructor Options

OptionTypeRequiredDescription
iframeIdstringYesThe ID of the iframe element
agentIdstringYesThe ID of the Halosight agent
typestringYesThe type of component to render (i.e. chat)
getIframeElementfunctionNoCustom function to retrieve the iframe element

Methods

MethodParametersReturnsDescription
onRegistercallback: () => voidHalosightEmbedRegister a callback for when the agent is initialized
onGetAuthcallback: () => Promise<any>HalosightEmbedRegister a callback that retrieves an access token from your backend. Must return a Promise resolving with the token.
insertAgentArgumentsargs: Record<string, unknown>HalosightEmbedPass arguments to the agent
insertUiAttributesattrs: Record<string, unknown>HalosightEmbedCustomize the UI appearance
onActioncallback: (action: ActionResponse, response: ActionResponseCallback)HalosightEmbedA callback that is invoked for ALL action types.
onSendEmailcallback: (emailParams: EmailParams, response: ActionResponseCallback)HalosightEmbedRegister a callback specifically for email actions