Chatbox
The webapp channel also comes with a configurable website plugin (called the Chatbox) that can be added to any website by adding a single line in your source code. The Chatbox will then appear as a small bubble in the bottom-right corner of your site for every visitor.

Installation

Simply add the following line of code in your source code, just before the closing </body> tag (replace it with the actual line that you can find in your Webapp configuration panel):
1
<script
2
src="https://chatbox.csml.dev/script.min.js?token=CHATBOX_TOKEN"
3
id="clevy-chatbox"
4
async>
5
</script>
Copied!
Once this is done, a chat bubble will appear as follows on every page where that code is included. Clicking the chat icon will open the chatbox:

Adding a Custom Greeting

CSML Studio has an option to display an optional greeting text when the chatbox is closed:
The content of the text bubble is configurable in the Chatbox settings at the bottom of the Webapp configuration panel. If that field is left empty, only the blue chat icon will appear.

Optional Attributes

Several configurations are available as standard HTML data attributes to maximize compatibility across browsers.
1
<script
2
src="{CHATBOX_URL}"
3
id="clevy-chatbox"
4
data-position="left"
5
data-webapp-metadata="%7B%22firstname%22%3A%22Jane%22%2C%22email%22%3A%22jane.doe%40company.com%22%7D"
6
async>
7
</script>
Copied!

data-position

By default, the chatbox will be displayed on the right side of the screen. To display the chatbox on the left instead, simply add data-position="left".

data-webapp-metadata

To add custom metadata in a chatbox (see this page for more information about injecting metadata in the webapp), you need to add a data-webapp-metadata attribute to the chatbox initialization script tag that contains the encoded (with javascript's encodeURIComponent function) JSON string of the metadata you want to inject.
For example: data-webapp-metadata="%7B%22email%22%3A%22jane.doe%40company.com%22%7D"

data-logo-url

You can configure a custom image to be used as the chatbox logo by setting this parameter to the URL of your image. You can use a transparent png or a svg to achieve this effect below, or directly use a square image (it will be rounded automatically) without a transparent background to use as the logo.
For example: data-logo-url="https://cdn.clevy.io/clevy-logo-square-white.png"

data-launcher-fill, data-launcher-background

These two parameters let you change the fill color of the default icons, as well as the background for the launcher button.
Any valid CSS value for these elements is accepted. The default values are:
1
<script src="{CHATBOX_URL}"
2
id="clevy-chatbox"
3
data-launcher-fill="#ffffff"
4
data-launcher-background="linear-gradient(135deg, #4f89fc 0, #1965ff 51%, #104dc7 100%)"
5
async></script>
Copied!

data-force-open

Force the chatbox to open as soon as the script is loaded. Not recommended as it might be a bit agressive for the visitors of the page, but may be useful in some cases!
1
<script src="{CHATBOX_URL}"
2
id="clevy-chatbox"
3
data-force-open="true"
4
async></script>
Copied!

data-ref

Set the inner webapp's ref param to trigger a specific flow or step
1
<script src="{CHATBOX_URL}"
2
id="clevy-chatbox"
3
data-ref="someRefParam"
4
async></script>
Copied!
Last modified 2mo ago