API Docs for: 2.0.20133.2
Show:

ui.virtualAgent Class

Virtual Agent UI Module

Item Index

Methods

Methods

render

(
  • config
)
Promise static

Render the VirtualAgent UI

Parameters:

  • config ui.virtualAgent.Config
    • [uiInfo] ui.UIInfo optional

      A ui.UIInfo object

      • [type] ui.HostType optional
        A value in {{#crossLink "ui.HostType"}}{{/crossLink}} which indicates the type of UI to render e.g. IFRAME, POPUP.
      • [containerSelector] String optional
        Only required for iframe -- a JQuery selector statement to define the element into which the iframe will be loaded
      • [height] Number optional
        The height of the rendered UI
      • [width] Number optional
        The 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);
    });