Methods
The AI form instance offers various methods to help you interact with and customize it.
Instance
Embed
Embed the AI form instance into your application. The selector is required, and is document querySelector to find the HTML-tag into which you want to embed the form.
isLoaded
Returns true
if the instance has been loaded and embedded into your application.
getVersion
Returns the current version of the SDK
destroy
Remove the form interface from your application.
Styling
getColorScheme
Get the current colorScheme.
setColorScheme
Sets your preferred color theme choices. auto
will use your OS color scheme.
getTheme
Get the theme configuration that has been set
setTheme
Set or change the theme of your interface. More info about theme configuration
Text
Most static text that you see in the form can be customized
getText
Get the text configuration that has been set
setText
Set or change the text of your interface. More info about text configuration
Language
getLanguage
Get the current language that is used. By default we will use the language that has been set as default in your project
setLanguage
Set or change the language of your interface. We support all ISO 639-1 language codes.
Context
Context allows you to supply pre-existing information to the form, helping the assistant avoid asking your customer unnecessary questions.
getContext
Get the context that have been set in the form instance.
updateContextField
Set or update a new key in the form instance context.
If you set a value to undefined
this key will be removed from the context.
Customer data
Customer data helps you to identify the customer behind a form session.
getCustomer
Returns the data we known about your customer.
setCustomer
Set or update customer data for the current form interface.
More info about customerData
Static methods
generateSessionId
Generate a unique session id
Last updated