Skip to main content

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) or HTMLElement
  • Required: No
  • Description: Where to mount the widget. Accepts any valid CSS selector (e.g. '#my-div', '.chat-area', 'tekstiai-widget') or a direct HTMLElement reference. 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 by container, 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 a container.
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', {...}).

caution

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.

KeyTypeDescription
styles-backgroundColorCSS colorMain background color of the widget
styles-buttonBackgroundColorCSS colorBackground color for action buttons
styles-controlsBackgroundColorCSS colorBackground color for the input area
styles-controlsTextColorCSS colorText color for controls
styles-questionBackgroundColorCSS colorBackground color for user message bubbles
styles-discussionTextColorCSS colorText color for chat messages
styles-placeholderImageURLCustom placeholder image
styles-chatContainerWidthCSS widthWidth of the chat container (default: '100%')
styles-baseFontSizeCSS sizeBase font size — all internal sizing is relative to this (default: '1rem')
styles-botAvatarColorCSS colorColor of the bot avatar

Behavior Overrides (options-*)

All option keys use the prefix options- followed by the camelCase property name.

KeyTypeDefaultDescription
options-welcomeMessagestringInitial message shown when the widget loads
options-maxLengthnumber360Maximum character length for input
options-inputPlaceholderTextstring'Type your question here...'Placeholder text in the input field
options-validateInputbooleanfalseEnable input validation
options-validationInputLengthnumber10Minimum characters required (when validation is on)
options-validationRegexRegExpCustom regex for input validation
options-validationErrorMessagestringError message shown on validation failure
options-copyButtonTextstring'Copy'Label for the copy button
options-copiedToClipboardTextstring'Copied!'Label shown after copying
options-referenceButtonTextstring'References'Label for the references button
options-referenceListHeaderTextstring'References'Header for the references list
options-gatheringReferencesTextstring'Gathering references...'Text shown while references load
options-referencesOpenByDefaultbooleanfalseWhether reference sections start expanded

Configuration Priority

PrioritySource
1 (highest)Dashboard configuration — loaded from TekstiAI API during initialization
2Override 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.