Widget SDK
Configuration
You can configure the widget during launch by setting the window.chtlConfig
object, as shown below.
Below are the available properties you can set.
chatIconVisible
Whether to display the chat icon (open and close buttons).
- Possible values:
true
,false
- Default:
true
displayType
The type of widget to display.
- Possible values:
floating
,fullscreen
,page_inline
- Default:
floating
language
The language of the widget in ISO 639-1 format. This will override the language set in your chatbot’s appearance settings.
- Possible values:
en
,ar
,az
,bg
,bn
,bs
,ca
,cs
,da
,de
,el
,en
,es
,et
,fa
,fi
,fr
,he
,hi
,hr
,hu
,hy
,id
,it
,ja
,ko
,lt
,lv
,mn
,ms
,nl
,no
,pl
,pt
,pt-br
,ro
,ru
,sk
,sl
,sq
,sr
,sv
,th
,tr
,uk
,ur
,vi
,zh-cn
,zh-tw
Methods
Below are the SDK methods you can call to interact with the widget.
Open chatbot
Opens the chatbot, similar to when a user clicks the chat icon.
Minimize chatbot
Minimizes the chatbot, similar to when a user clicks the minimize button in the widget.
Pass custom data after launch
You can send custom values to the chatbot at any point after it’s loaded.
The method takes an object containing the variable names and values. You must make sure that the variables have been created in the builder and that the names match exactly.
Remove chatbot
Removes the chatbot completely from the page.