onTypingUpdate()

Registers a function to call when the customer’s text in the chat window changes. If Sneak Peek is enabled, this function is called whenever the customer edits the text in the chat window. If Sneak Peek is not enabled, this function is called whenever a customer starts or stops typing in the chat window. Available in API version 29.0 or later.

NameTypeDescription
chatKeyStringThe chatKey associated with the chat for which to call a function when a customer begins typing a new message to the agent.
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 properties:

NameTypeDescription
isTypingBooleanIndicates whether a chat visitor is typing (true) or not (false).
sneakPeekStringThe text the chat visitor is currently typing into their input box in the chat window. This is visible only if Sneak Peek is enabled for the agent.
successBooleantrue if firing event was successful; false if firing event wasn’t successful.