Web Widget Deployment Guide-Direct Embedding
This guide covers the supported options to deploy the cim-web-init widget.
Embed in Website
The web-init is a plain HTML/Javascript application that can be deployed on any web server. It can also be deployed on Apache Tomcat, IIS server, or similar local servers.
Prerequisites
Make sure you have the following things available before deployment:
- Web Widget Repo to Clone Code. Click here.
- Any host website where you can deploy the widget.
- Widget Embedding Script with all the required credentials explained below.
Installation
Follow these steps to embed the web-init widget on your host site:
- first of all clone the repo from the GitLab link here. and make sure to run that widget code on any server of Apache Tomcat, IIS server, or similar local server.
- Once the web widget is hosted on any server. Update the configuration details as per the table given below.
- Once the configuration is updated add that script at the top in the Head tag <head> of the HTML Code of the target web application script provided below.
Script
Update the following configuration in the script.
Config Parameter Description initWidgetUrl IP or FQDN of the machine where the cim-web-init widget is hosted. customerWidgetUrl - IP or FQDN of the server where the Customer Widget is hosted.
widgetIdentifier
serviceIdentifier
is the service identifier for CIM chat.
widgetIdentifier Widget identifier of web widget instance defined in the Unified-Admin. serviceIdentifier This is the service identifier of the web channel defined in the Unified Admin. Add the script in the head section of the target web application.
JS<!-- CIM Script Tags --> <script type="text/javascript"> var __cim = __cim || {}; __cim.initWidgetUrl = "https://[HostName]"; //Init Widget Url __cim.customerWidgetUrl = "https://[HostName]/customer-widget"; //Customer Widget Url __cim.widgetIdentifier = "web"; //Widget Identifier __cim.serviceIdentifier = "+921218"; //Service Identifier (function () { var __cimScript = document.createElement("script"), __cimScriptTag = document.getElementsByTagName("script")[0]; __cimScript.src = __cim.initWidgetUrl + "/init_widget.js"; __cimScript.charset = "UTF-8"; __cimScriptTag.parentNode.insertBefore(__cimScript, __cimScriptTag); })(); </script> <!-- End CIM Script Tags -->