LogoLogo
  • A better way to do...stuff!
  • How we build the app
    • Overview
  • Documentation
    • Draftbit
      • Using Live Preview
      • Workspaces and Billing
      • Introduction to the Builder
      • Layout
      • Intro to Navigation
      • Fetching Data
      • Direct Integrations
      • FAQs
      • Draftbit
      • Draftbit
      • Custom Blocks
      • Borders, Background, and Elevation
      • Actions
      • Custom Screen Code
      • Exporting and Publishing Your Project
      • Sharing Your Project Online
      • Publishing Your App as a PWA
      • Stack Navigator
      • Tab Navigator
      • Draftbit
      • Draftbit
      • Basic
      • Media
      • REST Services & Endpoints
      • REST API Integrations
      • Themes & Styling
      • Submitting Data
      • Draftbit
      • Draftbit
    • Xano
      • resources-and-tips-1
        • 🎞️ Xano Video Tutorials
        • 🤝Community Corner
        • 💰Share Xano. Make money
      • FAQ
      • getting-started
        • ⚡ Jumpstart
        • 🎞️ The Xano Interface
      • instances
        • What is an Instance?
        • Early Access Instance
        • Upgrading an Instance
        • Sharing
        • Bandwidth Usage
        • API Rate Limit
      • What is a Workspace?
      • Dashboard
      • Database
      • Airtable Import
      • API
      • Library
      • Marketplace
      • Settings
      • authentication
        • Authentication
        • Sign-up & Log in
      • data-manipulation
        • The Function Stack
        • Addons (GraphQL-Like)
        • The Expression Builder
        • External Query Manipulation
        • Timestamp
        • Filters
        • Images
    • Expo
      • Creating your first build - Expo Documentation
    • Kommunicate
      • Installation
      • Installation
      • Installation
      • Installation
      • Installation
      • Flutter Installation
      • Installation
      • Zapier Integration
      • Authentication
      • CMS Installation
      • Authentication
      • Conversation
      • Conversation Assignment
      • Customization
      • Localization
      • Logout
      • Web Troubleshooting
      • Installation
      • Authentication
      • Push Notification
      • Conversation
      • Customization
      • Localization
      • Logout
      • Installation
      • Authentication
      • Push Notification
      • Conversation
      • Customization
    • Formito
      • basics
        • Getting Started
        • Variables
        • Are you GDPR ready?
        • How to prefill the values of my chatbot?
      • connect
        • How to connect Formito to Zapier?
      • convert
        • How to convert old formito chatbots to the new version?
        • How to convert Google Forms into a chatbot?
        • How to convert a Monday.com board to a chatbot?
        • How to create chatbot from QuickBase table?
      • guide
        • How to add my chatbot to WordPress?
        • How to create a chatbot for Zendesk?
      • shopify
        • How to embed my chatbot into a Shopify page?
        • How to display Formito chatbot on bottom corner of my Shopify store?
        • How to open my chatbot after clicking on links or buttons?
    • Stonly
  • Flex Stuff
    • App
    • APIs
    • Database
    • Website
    • Design
    • Style Guide
  • Content
    • Guides
    • ChatBots
    • Blogs
    • Whitepapers
  • Company
    • About us
    • Brand
    • Roadmap
    • Policies
  • Flex Together
    • Overview
    • Fair Finance
Powered by GitBook
On this page
  • Overview
  • Chat widget customization
  • Customize chat widget by using CSS
  • Greeting message for different web pages
  • Welcome message for different web pages
  • Full screen chat widget
  • Default metadata
  • Events
  • Example on how to subscribe to events

Was this helpful?

  1. Documentation
  2. Kommunicate

Customization

PreviousConversation AssignmentNextLocalization

Last updated 4 years ago

Was this helpful?

Overview

Kommunicate chat widget is where your users will chat and interact with your team. You can customize the theme, look and feel of the chat widget to fit with your brand's theme. You can either do it through Kommunicate Dashboard or add your own customization code manually.

Chat widget customization

You can change the primary color of your chat widget to your choice of color. The primary color of the elements inside the chat widget will also be changed to that color.

You can also change the chat launcher icon from our given list of multiple icons. You will find these settings in .

If you are in one of our paid plans, you can also upload your own image/icon and use as your customized chat launcher icon. Though, there are no hard restrictions of the shape of the image you want to use as the chat widget launcher icon, square images are preferred over others.

Customize chat widget by using CSS

Alternatively, you can pass custom CSS to customize the chat widget. Pass the CSS in Kommunicate.customizeWidgetCss() method as a string like shown in the example below.

var kommunicateSettings = {
    ...
    "onInit": function() {
        var css = "";        
        Kommunicate.customizeWidgetCss(css);
    },
    ...
}

To change sent messages color

Example : 

var cssChanges = ".mck-msg-right .mck-msg-box{background-color: blue!important;color:yellow!important;}";
Kommunicate.customizeWidgetCss(cssChanges);

To change received messages color

Example :

var cssChanges = ".mck-msg-left .mck-msg-box{background-color: blue!important;color:yellow!important;}";
Kommunicate.customizeWidgetCss(cssChanges);

To show/hide the chat widget

To hide the chat widget on page load, pass the following code inside the onInit function as given below:

"onInit": function () {
    Kommunicate.displayKommunicateWidget(false);
}

To disable the chat widget textarea

To hide the chat widget input textarea, pass the following code inside the onInit function as given below:

KommunicateGlobal.document.querySelector(".mck-box-form.mck-row").style.visibility="hidden";
KommunicateGlobal.document.querySelector(".mck-box-form.mck-row").style.display="none";

Example: To disable the chat widget textarea

    (function(d, m){
        var kommunicateSettings = 
            {"appId":"APP_ID","popupWidget":true,"automaticChatOpenOnNavigation":true,
         "onInit": function (){
            KommunicateGlobal.document.querySelector(".mck-box-form.mck-row").style.visibility="hidden"
            KommunicateGlobal.document.querySelector(".mck-box-form.mck-row").style.display="none"
            }
          }
        var s = document.createElement("script")
        s.src = "https://widget.kommunicate.io/v2/kommunicate.app"
        var h = document.getElementsByTagName("head")[0]
        window.kommunicate = m; m._globals = kommunicateSettings;
    })(document, window.kommunicate || {})

Hide (online/offline) status of agents on the web plugin

Please add the following code under "onInit" function

Kommunicate.customizeWidgetCss("div#mck-agent-status-text { display: none !important; } span.mck-agent-status-indicator { display: none !important }");

Example: To hide status if agents

(function(d, m){
var kommunicateSettings = {"appId":"APP_ID","popupWidget":true,"automaticChatOpenOnNavigation":true,"onInit": function() { 
Kommunicate.customizeWidgetCss("div#mck-agent-status-text { display: none !important; } span.mck-agent-status-indicator { display: none !important }");
}};
var s = document.createElement("script"); s.type = "text/javascript"; s.async = true;
s.src = "https://widget.kommunicate.io/v2/kommunicate.app";
var h = document.getElementsByTagName("head")[0]; h.appendChild(s);
window.kommunicate = m; m._globals = kommunicateSettings;
})(document, window.kommunicate || {});

To change chat pop-up widget text

Example :

var css = ".chat-popup-widget-text{color:red!important;}"
Kommunicate.customizeWidgetCss(css);

To change chat pop-up background color

Example :

var css = ".chat-popup-widget-container{background-color: blue!important;}"
Kommunicate.customizeWidgetCss(css);

To change chatwidget top header color

Example :

var css = ".mck-box-top {background-color: red!important;}"
Kommunicate.customizeWidgetCss(css);

To add extra characters to the bot name

Example :

var css = ".mck-tab-title{max-width:170px!important}"
Kommunicate.customizeWidgetCss(css);

Show the chat widget on click of a button:

Use the below mentioned code to show the chat widget on click of a button

<script type="text/javascript">
function openChat() {
    Kommunicate.displayKommunicateWidget(true); 
}
script>


<input type="button" value="HELP" id="button" disabled="true" onclick="openChat()">

Example : To show the chat widget on click of a button

<html>
<body> 
<script type="text/javascript">  
function openChat() {
   Kommunicate.displayKommunicateWidget(true);
   Kommunicate.launchConversation();
}
(function(d, m){
        var kommunicateSettings = {"appId":"APP_ID","popupWidget":true,"automaticChatOpenOnNavigation":true,
        
        "onInit": function()
        {
            Kommunicate.displayKommunicateWidget(false);
            document.getElementById("button").disabled=false;
        }
       }
        var s = document.createElement("script"); s.type = "text/javascript"; s.async = true;
        s.src = "https://widget.kommunicate.io/v2/kommunicate.app";
        var h = document.getElementsByTagName("head")[0]; h.appendChild(s);
        window.kommunicate = m; m._globals = kommunicateSettings;
      })(document, window.kommunicate || {});
script>
<input type="button" style="background-color:#5553B7;color:white;width:250px;
height:70px;" value="CHAT SUPPORT" id="button" disabled="true" onclick="openChat()"/>
body>
html>

Greeting message for different web pages

To override the message of the greeting pop up and to enable or disable it via code, use the following app options.

<script type="text/javascript">
  ...
    

     var kommunicateSettings = {
      "appId": "",  
      ...
      "appSettings": {
        "chatWidget": {
          "popup": false           
        },
        "chatPopupMessage": [{
          "message": "Overridden message", 
          "delay": 5000                    
        }]
      },
      ...
    };

    
  ...
script>

Welcome message for different web pages

Following code snippet will help you in setting the welcome message for different web pages.

        var pagelist = {
            "PAGE URL1": "WELCOME MESSAGE FOR PAGE-1",
            "PAGE URL2": "WELCOME MESSAGE FOR PAGE-2"
        }

        

      
                var defaultSettings = {
                    "WELCOME_MESSAGE": pagelist[window.location.pathname]
            
                }

                if (pagelist[window.location.pathname]) {
                    Kommunicate.updateSettings(defaultSettings);
                }
            }

NOTE: Do not forget to add your APP_ID, page URL, and welcome message before using the sample code mentioned in the repository.

Full screen chat widget

Default metadata

You can pass on additional information as metadata with every message. Add defaultMessageMetaData parameter in kommunicateSettings variable. Below is the example of how you can send metadata:

var kommunicateSettings = {
    ...
    "defaultMessageMetaData":{"key1":"value1", "key2":"value2", ...}
    ...
};

Events

To get real time updates regarding message sent and delivered you can subscribe to onMessageSent & onMessageReceived events.

  1. onMessageSent : This event gets triggered when the message is sent by the user.

  2. onMessageReceived : This event gets triggered when a new message is received by the user.

Example on how to subscribe to events

To subscribe to events you need to call Kommunicate.subscribeToEvents(events) function and pass the events object in it.

var kommunicateSettings = {
    ...
    "onInit": function () {
        var events = {
            'onMessageReceived': function (resp) {
            console.log(resp);
            
            },
            'onMessageSent': function (resp) {
            console.log(resp);
            
            }
        };
        Kommunicate.subscribeToEvents(events);
    },
    ...
}

NOTE: Replace "APP_ID" with the application Id that you get from

The limit for for option 1 and option 2 are 35 characters and 150 characters respectively.

Check the complete sample code in our , this will help you with placing the above code in the right section.

To make the chat widget full screen or to add it in a container, follow the instructions given in the readme of

Note: You can also update metadata using .

Kommunicate Dashboard -> Chat widget
https://dashboard.kommunicate.io/settings/install
Greeting message
repository
Kommunicate-Live-Chat-Plugin
KM_CHAT_CONTEXT