chasitor.addCustomEventListener()

Registers a function to call when a custom event is received in the chat window. Available in API version 29.0 or later.

NameTypeDescription
typestringThe type of custom event you want to listen for.
callbackfunctionJavaScript method called upon completion of the method.

This method is asynchronous so it returns its response in an object in a callback method. The response object contains the following methods:

NameTypeDescription
getTypemethodAccesses the type of the custom event that was sent to this chat window. Returns the type argument of the sforce.console.chat.sendCustomEvent() method used to send this event.
getDatamethodAccesses the data of the custom event that was sent to this chat window. Returns the data argument of the sforce.console.chat.sendCustomEvent() method used to send this event.
getSourcemethodAccesses the source of the custom event that was sent to this chat window—for example, agent or chat visitor.
getDatemethodAccesses the date of the custom event that was sent to this chat window. Returns the date and time the event was received.