Class: chatWindow

chatWindow()

chatWindow is the UI chat widget to send and receive messages from Kore.ai platform

Constructor

new chatWindow()

Source:

Methods

sendMessage(messageText, optionsopt, serverMessageObjectopt, clientMessageObjectopt)

# Send message to bot including rendering

Parameters:
Name Type Attributes Description
messageText String

message text to send

options Object <optional>

additional options

Properties
Name Type Description
renderMsg Object

override message to show in UI

serverMessageObject Object <optional>

overrides the properties of message object before sending to websocket

Properties
Name Type Description
customdata Object

customdata to send bot

message.metaTags Object

metaTags to send bot

message.nlMeta Object

nlMeta to send bot

clientMessageObject Object <optional>

overrides the properties of message object before sending to UI renderMessage method

Properties
Name Type Description
createdOn Object

customdata to send bot

message.clientMessageId Object

metaTags to send bot

message.cInfo.body Object

nlMeta to send bot

____

and more

Source:

Events

afterRenderMessage

afterRenderMessage will be triggered after appending the message html to chatwindow

Type:
  • object
Properties:
Name Type Description
messageHtml Object

message bubble html content

msgData Object

message data

chatWindowEvent Object
Source:

beforeRenderMessage

beforeRenderMessage will be triggered before appending the message html to chatwindow

Type:
  • object
Properties:
Name Type Description
messageHtml Object

message bubble html content

msgData Object

message data

chatWindowEvent Object
Source:

beforeViewInit

beforeViewInit will be triggered before the chat window dom element is attached to provided container.

Type:
  • object
Properties:
Name Type Description
chatEle Object

chat window dom element .

chatWindowEvent Object
Source:

beforeWSSendMessage

onWSMessage will be triggered on new message received from websocket

Type:
  • object
Properties:
Name Type Description
messageToBot Object

message data to be sent to to websocket

chatWindowEvent Object
Source:

jwtSuccess

jwtSuccess will be triggered once the jwt token received from API.

Type:
  • Object
Properties:
Name Type Description
jwt String

jwt token from server response .

Source:

onChatHistoryResponse

onChatHistoryResponse will be triggered on chatHistory API response

Type:
  • object
Properties:
Name Type Description
historyResponse Object

chatHistory API response

chatWindowEvent Object
Source:

onKeyDownEvent

onKeyDownEvent will be triggered on Keydown Event

Type:
  • object
Properties:
Name Type Description
keyDownEvent Object
chatWindowEvent Object
Source:

onWSMessage

onWSMessage will be triggered on new message received from websocket

Type:
  • object
Properties:
Name Type Description
messageData Object

message data received from websocket

chatWindowEvent Object
Source:

onWSOpen

onWSOpen will be triggered on new websocket connection open

Source:

viewInit

viewInit will be triggered once the chat window dom element is attached to provided container.

Type:
  • object
Properties:
Name Type Description
chatEle Object

chat window dom element .

chatWindowEvent Object
Source: