Getting Started

Introduction

Tolki Embed is an AI-powered chat widget that you can add to any website with a single HTML tag.

Tolki Embed is a web component built with Lit Element that provides an embeddable chat interface. It connects to the Tolki AI backend to deliver intelligent conversational experiences on any website.

Key Features

  • One-tag integration — Add <tolki-chat> to your HTML and you're done
  • Zero dependencies — Distributed as a standalone IIFE bundle
  • Shadow DOM — Fully encapsulated styles, no CSS conflicts
  • 27 HTML attributes — Full control over appearance and behavior
  • Multilingual — Built-in support for EN, IT, ES, FR, DE, PT
  • Dark mode — Automatic, light, or dark
  • Responsive — Mobile-first with virtual keyboard detection
  • Chat history — Persisted per bot instance in localStorage

How It Works

The widget loads as a single JavaScript file and registers a <tolki-chat> custom element. When you provide a bot UUID, it fetches the bot configuration from the Tolki API and renders the chat interface.

<!-- 1. Load the script -->
<script src="https://embed.tolki.ai/chat.js" defer></script>

<!-- 2. Add the component -->
<tolki-chat bot="YOUR-BOT-UUID"></tolki-chat>

The component supports a priority system for configuration:

  1. HTML Attributes (highest priority) — Values set directly in the tag
  2. Backend — Values from the Tolki API based on bot configuration
  3. Defaults (lowest priority) — Built-in fallback values

This means you can customize everything client-side via HTML attributes, and the backend configuration serves as the base.