Standard
You can get the standard HTML and Javascript code by clicking on the “HTML & Javascript” button in the “Share” tab of your zazubot. There, you can change the container dimensions. Here is a code example:See all possible settings
See all possible settings
Multiple bots
If you have different bots on the same page you will have to make them distinct with an additionalid
prop:
Popup
You can get the popup HTML and Javascript code by clicking on the “HTML & Javascript” button in the “Share” tab of your zazubot. Here is an example:See all possible settings
See all possible settings
Bubble
You can get the bubble HTML and Javascript code by clicking on the “HTML & Javascript” button in the “Share” tab of your zazubot. Here is an example:See all possible settings
See all possible settings
Custom button position
You can move the button with some custom CSS on your website. For example, you can place the bubble button higher with the following CSS:Commands
Here are the commands you can use to trigger your embedded typebot:-
zazubot.open()
: Open popup or bubble -
zazubot.close()
: Close popup or bubble -
zazubot.toggle()
: Toggle the bubble or popup open/close state, -
zazubot.showPreviewMessage()
: Show preview message from the bubble, -
zazubot.hidePreviewMessage()
: Hide preview message from the bubble, -
zazubot.setPrefilledVariables(...)
: Set prefilled variables. Example:For more information, check out Additional configuration. -
zazubot.setInputValue(...)
: Set the value in the currently displayed input. -
zazubot.sendCommand(...)
: Send a command to the bot.
For each command you can pass an optional
id
prop to target a specific zazubot. I.e. zazubot.open({ id: 'my-bubble' })
Callbacks
If you need to trigger events on your parent website when the user interact with the bot, you can use the following callbacks:Additional configuration
You can prefill the bot variable values in your embed code by adding theprefilledVariables
option. Here is an example:
Current URL
variable with “https://my-site/account” and the User name
variable with “John Doe”. More info about variables: here.
Note that if your site URL contains query params (i.e. https://zazubot.com?User%20name=John%20Doe), the variables will automatically be injected to the zazubot. So you don’t need to manually transfer query params to the bot embed configuration.