Configuration Reference
The TekstiAI Widget is initialized using the window.TekstiAI('boot', {...}) function.
Widget appearance and behavior (colors, texts, validation rules, etc.) are configured through your TekstiAI dashboard and loaded automatically during initialization — no code changes needed for most customizations.
Configuration Structure
window.TekstiAI('boot', {
// Required
widget_id: 'your-widget-id'
// Optional
container: '#my-container',
api_url: 'https://app.teksti.ai/api/v1/widget',
mode: 'inpage',
});
Parameters
widget_id
- Type:
string - Required: Yes
- Description: Your unique widget identifier from TekstiAI.
widget_id: 'wdgt_abc123xyz789'
container
- Type:
string(CSS selector) orHTMLElement - Required: No
- Description: Where to mount the widget. Accepts any valid CSS selector (e.g.
'#my-div','.chat-area','tekstiai-widget') or a directHTMLElementreference. If the selector resolves to a<tekstiai-widget>element, the widget mounts directly into it; otherwise a<tekstiai-widget>element is created inside the matched element. If omitted, the widget uses the first existing<tekstiai-widget>on the page, or appends one to<body>.
container: '#chat-container' // CSS selector
container: 'tekstiai-widget' // matches <tekstiai-widget> element directly
api_url
- Type:
string - Required: No
- Default:
'https://app.teksti.ai/api/v1/widget' - Description: Base URL for the TekstiAI API. Only set this when directed to by your TekstiAI account manager (e.g. for staging or on-premise deployments).
api_url: 'https://app.teksti.ai/api/v1/widget'
mode
- Type:
'inpage'|'chatbot' - Required: No
- Default:
'inpage' - Description: Controls how the widget is rendered.
'inpage'— Widget renders inside the element specified bycontainer, filling its dimensions. Use this when embedding the widget as part of a page layout.'chatbot'— Widget renders as a fixed overlay on top of the page (chat bubble + modal). This mode is typically managed by the TekstiAI Chatbot Wrapper and does not require acontainer.
mode: 'inpage' // default — embed in page
mode: 'chatbot' // floating chat bubble
Style and Behavior Overrides
Widget styles and behavior are loaded from your TekstiAI dashboard configuration. In most cases you should make changes there rather than in code.
If you need to override specific values at initialization time (e.g. for testing or per-page customization), you can pass the following prefixed keys to window.TekstiAI('boot', {...}).
Override values passed at initialization have lower priority than your dashboard configuration. They serve as defaults that dashboard settings will override. Use the TekstiAI dashboard as your primary configuration tool.
Style Overrides (styles-*)
All style keys use the prefix styles- followed by the camelCase property name.
| Key | Type | Description |
|---|---|---|
styles-backgroundColor | CSS color | Main background color of the widget |
styles-buttonBackgroundColor | CSS color | Background color for action buttons |
styles-controlsBackgroundColor | CSS color | Background color for the input area |
styles-controlsTextColor | CSS color | Text color for controls |
styles-questionBackgroundColor | CSS color | Background color for user message bubbles |
styles-discussionTextColor | CSS color | Text color for chat messages |
styles-placeholderImage | URL | Custom placeholder image |
styles-chatContainerWidth | CSS width | Width of the chat container (default: '100%') |
styles-baseFontSize | CSS size | Base font size — all internal sizing is relative to this (default: '1rem') |
styles-botAvatarColor | CSS color | Color of the bot avatar |
Behavior Overrides (options-*)
All option keys use the prefix options- followed by the camelCase property name.
| Key | Type | Default | Description |
|---|---|---|---|
options-welcomeMessage | string | — | Initial message shown when the widget loads |
options-maxLength | number | 360 | Maximum character length for input |
options-inputPlaceholderText | string | 'Type your question here...' | Placeholder text in the input field |
options-validateInput | boolean | false | Enable input validation |
options-validationInputLength | number | 10 | Minimum characters required (when validation is on) |
options-validationRegex | RegExp | — | Custom regex for input validation |
options-validationErrorMessage | string | — | Error message shown on validation failure |
options-copyButtonText | string | 'Copy' | Label for the copy button |
options-copiedToClipboardText | string | 'Copied!' | Label shown after copying |
options-referenceButtonText | string | 'References' | Label for the references button |
options-referenceListHeaderText | string | 'References' | Header for the references list |
options-gatheringReferencesText | string | 'Gathering references...' | Text shown while references load |
options-referencesOpenByDefault | boolean | false | Whether reference sections start expanded |
Configuration Priority
| Priority | Source |
|---|---|
| 1 (highest) | Dashboard configuration — loaded from TekstiAI API during initialization |
| 2 | Override values passed to window.TekstiAI('boot', {...}) |
| 3 (lowest) | Built-in defaults |
Configure your widget through the TekstiAI dashboard for changes to take effect without code deployments.