Note: If you don’t need to verify the identity of logged-in users, you can skip the first script in the embed code and only use the chatbot embed script.Here’s an example of the embed code you’ll find on the dashboard:
registerTools
method:
Load the Chatbase script and call the registerTools
method with all the actions and include all the logic that will run when each action is called. The action names must match that written in the custom action page.
args
: Contains all the arguments defined in your custom action configurationuser
: Contains the authenticated user information if identity verification is properly configureddata
and status
:
status
and error message
:
registerTools
multiple times will override previous actions. Make sure to provide all desired actions in a single registerTools
call.
Environment Limitations: Client-side custom actions will not work in the Chatbase Playground or Compare features, as these environments don’t support client-side code execution.