ui.virtualAgent.SDK Class
An object resolved by the render() method to interact with the virtual agent component
Item Index
Methods
Methods
endChat
()
Ends Chat with live agent in Virtual Agent
Example:
ui.virtualAgent.render(config).then(
function(sdk) {
// End the chat
sdk.endChat();
},
function() {
console.log("Unable to render virtual agent");
});
sendMessage
(
Promise
-
message
Insert a message in the user's chat with virtual agent
Parameters:
-
message
StringA message to send to virtual agent
Returns:
Example:
ui.virtualAgent.render(config).then(
function(sdk) {
// Send a message to virtual agent
sdk.sendMessage("Test message");
},
function() {
console.log("Unable to render virtual agent");
});
showFeedback
()
shows feedback in Virtual Agent
Example:
ui.virtualAgent.render(config).then(
function(sdk) {
// show virtual agent feedback
sdk.showFeedback();
},
function() {
console.log("Unable to render virtual agent");
});
startOver
()
Resets Virtual Agent
Example:
ui.virtualAgent.render(config).then(
function(sdk) {
// Reset virtual agent and start over
sdk.startOver();
},
function() {
console.log("Unable to render virtual agent");
});