(pixel) Add skip initialization option

This commit is contained in:
Baptiste Arnaud
2023-06-28 10:29:58 +02:00
parent 033f8f99dd
commit 50fcbfd95e
12 changed files with 822 additions and 276 deletions

View File

@@ -184,6 +184,28 @@ typebot-bubble::part(preview-message) {
}
```
## Callbacks
If you need to trigger events on your parent website when the user interact with the bot, you can use the following callbacks:
```js
Typebot.initStandard({
typebot: 'my-typebot',
onNewInputBlock: (inputBlock) => {
console.log('New input block displayed', inputBlock.id)
},
onAnswer: (answer) => {
console.log('Answer received', answer.message, answer.blockId)
},
onInit: () => {
console.log('Bot initialized')
},
onEnd: () => {
console.log('Bot ended')
},
})
```
## Additional configuration
You can prefill the bot variable values in your embed code by adding the `prefilledVariables` option. Here is an example: