Custom document is the way CTLive offers in order to store custom JS or CSS document into the system, and use them to realize customization in style or different behavior in logic.
It’s possible to find the custom document object structure here Custom Document Object
When you need to load a new document, you need to provide the following information:
Attribute | Description | Notes |
---|---|---|
id | unique identifier | |
customDocument | content of the document | Content is stored as is. All spaces, carriage returns or special characters are kept. |
contentType | contentType to be used to retrieve the document | Possibile values are: text/javascript text/css |
version | number identifying the version of the document | it’s intended for a future versioning feature not yet implemented |
Once the document is stored, it’s retrievable using the following URL:
https://<url>/livechat/<tenant>/customDocument/popup.css?v=1
Custom CSS
In the service configuration, you may use a custom CSS, pointing the configuration to the custom document with a relative url.
The following it’s an example of configuration:
{ "_id" : ObjectId("5d998c8a3e5c29412486fca8"), ... "custom_css" : "customDocument/popup.css?v=1", }
Custom JS
A custom JS can be used in multiple context.
Widget
As require attribute use the following syntax:
"require": "customDocument/mywidget.js?v=1"