Developers
Widget code, the product catalogue, the Order API and webhooks.
Developers¶
| You want to | Use | Credential |
|---|---|---|
| Put the chat on your site | Widget | Public key (pk_live_…), safe to publish |
| Send products to the agent | Product API, or a file or feed | Workspace API key (kok_…) |
| Read and update orders | Order API | Workspace API key (kok_…) |
| Receive events | Webhooks | Signing secret (whsec_…) |
| Add chat products to your own cart | Add to cart | None |
Base URL https://backend.kothok.ai, JSON over HTTPS. Keys and the webhook are under
Settings → API and webhooks. Keep the API key and signing secret on your server.
Widget code
- Widget options Every data-* attribute on the Kothok widget script tag, its default, and which ones the dashboard settings replace.
- Frameworks How to add the Kothok widget in React, Next.js, single-page apps, WordPress, Shopify and Google Tag Manager.
- Security What the Kothok widget's public key exposes, how allowed domains work, the CSP to allow, and what the widget stores in the browser.
- Add to cart Send products from the Kothok chat into your own JavaScript cart with the cart hook, and refresh your cart icon when an item is added.
- Chat events Listen to what happens in the Kothok chat from your own page, or track it in Google Tag Manager, with chat, cart and order events.
Product catalogue
- Import methods The six ways to bring a shop's products into Kothok, from Shopify and WooCommerce to a feed, a file or the Product API.
- Product API Send products to Kothok over HTTP with the Product API: turn it on, authenticate with the API key, and handle the answer.
- Product fields Every field a product can carry in the Kothok Product API, with types, limits and how variants are shown.
- File and feed columns The column names Kothok reads from a product feed or an uploaded CSV or Excel file, and how price, stock and variants map.
- Test the setup Six quick checks to run before shoppers use your Kothok product setup.
Webhooks
- Set up webhooks Send Kothok events to your own system as signed JSON: set up the webhook, the request format, auth headers, test events and the log.
- Events Every Kothok webhook event, when it is sent, and an example body for each: leads, conversations, tickets, meetings and orders.
- Verify signatures Check that a webhook request came from Kothok: the HMAC-SHA256 signature, with Node.js, Python and PHP samples.
- Retries and resends How Kothok retries a failed webhook, how to handle repeats and out-of-order events, and how to resend a delivery.