lightning:conversationCustomEvent

Event triggered when a custom event occurs during a chat.

Response 

NameTypeDescription
recordIdStringThe ID of the work record that’s associated with the current chat.
typeStringThe type of the custom event that was sent to this chat; corresponds to the type argument of the liveagent.chasitor.sendCustomEvent() method used to send this event from the chat window.
dataStringThe data of the custom event that was sent to this chat; corresponds to the data argument of the liveagent.chasitor.sendCustomEvent() method used to send this event from the chat window.

Example 

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" description="Conversation toolkit api sample">
2  <lightning:conversationToolkitAPI aura:id="conversationKit" />
3  <aura:handler event="lightning:conversationCustomEvent" action="{!c.onCustomEvent}" />
4</aura:component>

Controller code:

1({
2    onCustomEvent: function(cmp, evt, helper) {
3        var conversation = cmp.find("conversationKit");
4        var data = evt.getParam("data");
5        var type = evt.getParam("type");
6
7        console.log("type:" + type + " data:" + data);
8    }
9})