ui.chat.SDK Class
An object resolved by the render() method to interact with the chat component
Item Index
Methods
Methods
sendMessage
(
Promise
-
message
Insert a message in the user's chat with an agent
Parameters:
-
message
StringA message to insert in the chat
Returns:
Example:
ui.chat.render(config).then(
function(sdk) {
// Send a message to agent
sdk.sendMessage("Test message");
},
function() {
console.log("Unable to render chat");
});
updateContext
(
Promise
-
properties
Update the current chat context
Parameters:
-
properties
ObjectList of properties to update
Returns:
Example:
ui.chat.render(config).then(
function(sdk) {
// Update the current chat context
sdk.updateContext({ foo: "bar" });
},
function() {
console.log("Unable to render chat");
});