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:
(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
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.
onMessageSent : This event gets triggered when the message is sent by the user.
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