Integrate WebChat 2.0 FrontEnd into HTML
Note
An Enterprise license or higher is required to access these features.
Introduction
The WebChat application can be added to your SharePoint by adding some scripts to your page or pages. The scripts will load WebChat into your page.
Enable webchat into HTML
-
Edit the HTML where you want to add the WebChat.
-
Use the URL where you have deployed the WebChat Frontend and include the webchat.bootstrap.js file from the webchat folder on your website:
Note
Without the correct configuration object the WebChat FrontEnd will by default be set to hidden. See the next step.
CopyHTML<script src="path/to/webchat/webchat.bootstrap.js"></script>
<script> WebChat.load() </script> -
With the following Typescript definition of the configuration object:
Note
We will discuss the various properties of this configuration object in additional configurations , see: WebChat 2.0 for WebAgent Additional Configuration
CopyScriptinterface Configuration {
teaseMessageSettings?: TeaseMessageSettings;
templates?: Templates;
parent?: HTMLElement;
} -
Save the Page.
Example with configuration object to show the WebChat FrontEnd
<script src="path/to/webchat/webchat.bootstrap.js"></script>
<script>
const config = {
available: {
state: 'Enabled'
},
away: {
state: 'Enabled'
},
busy: {
state: 'Enabled'
},
offline: {
state: 'Enabled'
}
};
WebChat.load(config);
</script>