Skip to main content
Skip table of contents

Web-init Widget Deployment Guide

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:

  1. Web Widget Repo to Clone Code. Click here.
  2. Any host website where you can deploy the widget.
  3. Widget Embedding Script with all the required credentials explained below.

Installation

Follow these steps to embed the web-init widget on your host site:

  1. 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.
  2. Once the web widget is hosted on any server. Update the configuration details as per the table given below.
  3. 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

  1. Update the following configuration in the script.

    Config ParameterDescription
    initWidgetUrlIP or FQDN of the machine where the cim-web-init widget is hosted.
    customerWidgetUrl
    1. IP or FQDN of the server where the Customer Widget is hosted.
    2. widgetIdentifier 
    3. serviceIdentifier is the service identifier for CIM chat.
    widgetIdentifierWidget identifier of web widget instance defined in the Unified-Admin. 
    serviceIdentifierThis is the service identifier of the web channel defined in the Unified Admin.  
  2. 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 -->
    

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.