ui.virtualAgent Class
Virtual Agent UI Module
Item Index
Methods
- render static
Methods
render
(
Promise
static
-
config
Render the VirtualAgent UI
Parameters:
-
config
ui.virtualAgent.ConfigA ui.virtualAgent.Config object
-
[uiInfo]
ui.UIInfo optionalA ui.UIInfo object
-
[type]
ui.HostType optionalA value in {{#crossLink "ui.HostType"}}{{/crossLink}} which indicates the type of UI to render e.g. IFRAME, POPUP. -
[containerSelector]
String optionalOnly required for iframe -- a JQuery selector statement to define the element into which the iframe will be loaded -
[height]
Number optionalThe height of the rendered UI -
[width]
Number optionalThe width of the rendered UI
-
-
Returns:
Promise:
A promise that resolves to a ui.virtualAgent.SDK object when the UI component has successfully loaded
Example:
// Render virtualAgent as a POPUP.
// More UIInfo examples available here
var uiInfo = {
type: MsSupportSdk.ui.HostType.POPUP,
width: 600,
height: 800
};
// Create a virtual agent config
var config = {
uiInfo: uiInfo
locale:"en-us"
environment: MsSupportSdk.ui.virtualAgent.Environment.PRODUCTION, // use DEV for testing
onInitialized: function() {
console.log("Virtual Agent initialized");
}
};
// Render virtual agent UI
MsSupportSdk.ui.virtualAgent.render(config).then(
function(vaSDK) {
// See ui.virtualAgent.SDK for details about virtualAgentSDK.
// vaSDK.sendMessage("Test message"); // Send a message to virtual agent
},
function(err) {
console.log(err.message);
});