TheDocumentation Index
Fetch the complete documentation index at: https://docs.voltai.ai/llms.txt
Use this file to discover all available pages before exploring further.
Voltai.load() function returns an instance with methods to control the widget from your code.
Widget visibility
open()
Opens the chat panel. If the visitor does not already have a guest or signed-in session, the widget opens into its verification step first. After verification completes, the chat UI appears automatically.close()
Closes the chat panel.toggle()
Toggles the chat panel open or closed.Sending messages
sendChat(query, options)
Sends a chat message programmatically. This lets you start conversations from your own code, like a search box or help button. If the visitor does not already have a guest or signed-in session, the widget opens, keeps the latest queued query, shows the verification step, and submits the message automatically after verification succeeds.| Name | Type | Description |
|---|---|---|
query | string | The message to send |
options | object | Required settings (see below) |
| Property | Type | Required | Description |
|---|---|---|---|
topics | string[] | Yes | Topic names to associate with the message. The backend resolves names to full topic objects. |
newChat | boolean | No | Start a new conversation (default: false) |
Promise<void>
Example: Basic usage
Example: Start a new chat
Example: Combined with open
sendChat() no longer requires you to pre-authenticate the visitor yourself. If verification is needed, the widget handles it inline and submits the latest queued message afterward.Authentication
login()
Opens the login popup for users to sign in. You can call this before the widget is opened. If the widget is still finishing its initial auth bootstrap, the SDK waits until auth is ready and then runs the login flow.logout()
Logs out the current user and clears their session.isLoggedIn()
Returns whether a user is signed in. Returnsfalse for guest users, and also returns false until auth initialization has settled.
boolean
isAuthReady()
Returns whether the widget has finished restoring the current auth state.boolean
Cleanup
destroy()
Removes the widget from the page and cleans up all resources.- Navigating away in a single-page app
- Conditionally removing the widget
- Reinitializing with different settings