Events

You can listen for emitted events by subscribing to them using the on method with your custom callback. For example, your function can be executed every time a new message is received

on

Subscribes to emitted events, which are described below. This function returns a subscription id that can be used to unsubscribe.

aiForm.on(eventName, (payload) => void);

off

Unsubscribes from emitted events, which are described below.

aiForm.off(subscriptionId);

Events list

Event name
Description

initialized

AI form has been initialised and is ready to be used

error

Unexpected error has occurred

message.inbound

New message is received. Messages are send partially and need to be reconstructed

message.outbound

Message is send by the user

session.completed

User has filled in all necessary fields. Form session has been marked as completed

typing.started

Is typing is triggered by the agent

typing.stopped

Is typing stopped

Last updated