Developer documentation
Add the Kothok agent to any site with a single snippet, then configure and control it however you like. The widget is lightweight and loads asynchronously, so it never blocks your page.
#Introduction
Kothok ships as a lightweight browser widget. You embed one script on your website, and the agent, trained on your own content, appears and starts answering visitors. No build step, no framework required.
You’ll need a public key (starts with pk_live_), which you can copy from your Kothok dashboard under Installation.
#Quickstart
Paste this snippet just before the closing </body> tag on any page you want the agent to appear:
<script
src="https://static.kothok.ai/js/widgets.js"
data-public-key="pk_live_xxxxxxxxxxxx"
async
></script>That’s it. Reload the page and the widget appears in the bottom corner. No build step and no backend to run.
#Configuration
The widget is configured with data-* attributes on the script tag.
| Attribute | Required | Description |
|---|---|---|
data-public-key | Yes | Your workspace public key (pk_live_…). |
async | Recommended | Loads the widget without blocking page render. |
Appearance, welcome message, language, and behavior are managed from your dashboard, so you can change them without touching code.
#Frameworks
In React / Next.js, load the script with the framework’s script helper so it’s injected once, after hydration:
// app/layout.tsx (Next.js)
import Script from "next/script";
<Script
src="https://static.kothok.ai/js/widgets.js"
data-public-key="pk_live_xxxxxxxxxxxx"
strategy="lazyOnload"
/>The same snippet works in Vue, Angular, Svelte, or plain HTML, anywhere you can add a <script> tag.
#Webhooks & REST API
Programmatic access comes in two parts. Webhooks for real-time events are on Growth and above. The REST API for conversations and captured leads is on Business and above.
Need help wiring it up, or a webhook event we don’t send yet? Contact our team, and we’ll help you set it up.
#Security
The widget loads over HTTPS and uses a public key scoped to your workspace, and never exposes private credentials in the browser. Your business content and customer conversations are handled securely and used only to power your own agent.
#Support
Stuck, or want a hand with a custom setup? We’re happy to help.
Discover what Kothok can do for your business
Kothok helps businesses build better, personal, and human customer experiences with AI.