credentials
, options
, variables
and logs
as arguments.
The credentials
are the credentials that the user has entered in the credentials block.
The options
are the options that the user has entered in the options block.
The variables
object contains helper to save and get variables if necessary.
The logs
allows you to log anything during the function execution. These logs will be displayed as toast in the preview mode or in the Results tab on production.
getStreamVariableId
function defines which variable should be streamed.
The run
works the same as the server function. It needs to return Promise<ReadableStream<any> | undefined>
.
client
object.
args
and content
.
args
is an object with arguments that are passed to the content
context. Note that the arguments can’t be undefined
. If you want to pass an not defined argument, you need to pass null
instead.
content
is the code that will be executed on the client. It can call the arguments passed in args
.
displayEmbedBubble
object. See Cal.com
block
as an example.
Example:
displayEmbedBubble
accepts a parseInitFunction
function. This function needs to return the same object as the web
function. The function content can use the typebotElement
variable to get the DOM element where the block is rendered.
Optionally you can also define a waitForEvent
object. This object accepts a getSaveVariableId
function that returns the variable id where the event data should be saved. It also accepts a parseFunction
function that returns the same object as the web
function. The function content can use the continueFlow
function to continue the flow with the event data.