lightning:conversationCustomEvent

Event triggered when a custom event occurs during a chat.

Response

Name Type Description
recordId String The ID of the work record that’s associated with the current chat.
type String The 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.
data String The 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:

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

Controller code:

({
    onCustomEvent: function(cmp, evt, helper) {
        var conversation = cmp.find("conversationKit");
        var data = evt.getParam("data");
        var type = evt.getParam("type");

        console.log("type:" + type + " data:" + data);
    }
})