Skip to main content

Functions

The website widget exposes a set of functions on the global window.Kapa object, allowing you to manipulate it programmatically. The following functions are available:

open

Open the website widget.

Optional parameters:

ParameterTypeDefaultDescription
mode'search' | 'ai''ai'The mode the widget is set to when the modal is opened.
querystring''Opens the widget with this query prefilled.
submitbooleanfalseAutomatically submit the query when the model is opened.

Example usage:

window.Kapa.open({
mode: "ai",
query: "How to get started?",
submit: true,
});

close

Close the website widget.

Example usage:

window.Kapa.close();