Customization
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 Kommunicate Dashboard -> Chat widget.
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.
To change sent messages color
To change received messages color
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:
To disable the chat widget textarea
To hide the chat widget input textarea, pass the following code inside the onInit function as given below:
Example: To disable the chat widget textarea
Hide (online/offline) status of agents on the web plugin
Please add the following code under "onInit" function
Example: To hide status if agents
NOTE: Replace "APP_ID" with the application Id that you get from https://dashboard.kommunicate.io/settings/install
To change chat pop-up widget text
To change chat pop-up background color
To change chatwidget top header color
To add extra characters to the bot name
Show the chat widget on click of a button:
Use the below mentioned code to show the chat widget on click of a button
Example : To show the chat widget on click of a button
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.
The limit for Greeting message for option 1 and option 2 are 35 characters and 150 characters respectively.
Welcome message for different web pages
Following code snippet will help you in setting the welcome message for different web pages.
Check the complete sample code in our repository, this will help you with placing the above code in the right section.
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
To make the chat widget full screen or to add it in a container, follow the instructions given in the readme of Kommunicate-Live-Chat-Plugin
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:
Note: You can also update metadata using KM_CHAT_CONTEXT.
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.
Last updated