Newer Version Available
Snap-Ins Chat Custom Event APIs
There are three APIs that let you create custom chat events with Snap-ins Chat.
Available using Snap-ins code snippet version 5.0 and later.
embedded_svc.liveagentAPI.sendCustomEvent()
Sends a custom event to the agent console of the agent who is currently chatting with a customer.
| Name | Type | Description |
|---|---|---|
| data | string | Additional data you want to send to the agent console along with the custom event. |
| type | string | The name of the custom event to send to the agent console. |
embedded_svc.liveagentAPI.getCustomEvents()
Retrieves a list of custom events from both agent and chasitor that have been received during this chat session.
| Name | Type | Description |
|---|---|---|
| callback | function | JavaScript method called upon completion of the method. It passes a JSON formatted string of the events. |
embedded_svc.liveagentAPI.addCustomEventListener()
Registers a function to call when a custom event is received in the chat window.
| Name | Type | Description |
|---|---|---|
| callback | function | JavaScript method called upon completion of the method. It passes a JSON formatted string of the events. |
| type | string | The type of custom event you want to listen for. |