krt.talk

show

Show messenger

krt('talk', 'show');

hide

Hide messenger

krt('talk', 'hide');

setMessageInTextArea

Set message in the text area.
And show messenger if not shown.

krt('talk', 'setMessageInTextArea', {
  text: 'hello'
});

sendFromUser

Send message as user.

krt('talk', 'sendFromUser', {
  text: 'hello'
})

onShow

Register a callback function when the messenger is shown.

krt('talk', 'onShow', () => {
   // YOUR CODE...
});

onHide

Register a callback function when the messenger is hidden.

krt('talk', 'onHide', () => {
   // YOUR CODE...
});

onChangeUnreadMessageCount

Register a callback function when the number of unread messages has changed.

krt('talk', 'onChangeUnreadMessageCount', ({ count }) => {
   // YOUR CODE...
});

onChangeAssignee

Register a callback function when the assignee has changed.

krt('talk', 'onChangeAssignee', ({ assigneeId }) => {
   // YOUR CODE...
});

onChangeChatStatus

Register a callback function when the chatStatus has changed.
chatStatus is one of the following: open or closed or waiting.

krt('talk', 'onChangeChatStatus', ({ chatStatus }) => {
   // YOUR CODE...
});