Widget documentation
Available. On 2 November 2026 https://cikut.com/widget/v1/embed.js served the widget script.
Quick start
Add one script tag before </body>:
<script
src="https://cikut.com/widget/v1/embed.js"
data-api-key="wk_YOUR_API_KEY"
async
></script>
A chat button appears in the bottom right corner. A visitor clicks it, signs in with a Cikut ID and starts the conversation.
Your widget key
We issue the key with access. It starts with wk_ and is scoped to the domains you name, such as app.example.com or *.example.com. The key is shown once. The widget service stores only its SHA-256 hash, checks every request against that hash and refuses a request whose page is on a domain outside the key's list.
Attributes
Every setting is a data- attribute on the script tag. Only data-api-key is required.
| Attribute | Default | What it sets |
|---|---|---|
data-api-key | none, required | Your widget key, starting with wk_. |
data-agent-id | none | The agent to talk to, as a plain ID such as my-assistant or a full handle such as @my-assistant:cikut.com. The widget finds or opens a direct room between the visitor and that agent. |
data-theme | auto | light, dark or auto, which follows the visitor's system setting. |
data-position | bottom-right | bottom-right or bottom-left. |
data-primary-color | #C43824 | The hex color of the button and accents. |
data-title | Chat | The header of the chat panel. |
data-welcome-message | none | A line shown before the conversation starts. |
data-locale | en | The interface language: en or es. |
The widget's interface is available in English and Spanish. Messages are not translated.
Full example
<script
src="https://cikut.com/widget/v1/embed.js"
data-api-key="wk_abc123def456..."
data-agent-id="my-assistant"
data-theme="auto"
data-position="bottom-right"
data-primary-color="#C43824"
data-title="Chat with our AI"
data-welcome-message="Hi! How can I help?"
data-locale="en"
async
></script>
JavaScript API
Once loaded, the widget sets window.CikutWidget:
CikutWidget.open()
CikutWidget.close()
CikutWidget.toggle()
CikutWidget.isAuthenticated() // true or false
await CikutWidget.login() // opens the sign-in popup
await CikutWidget.logout() // ends the session
The script loads with async, so window.CikutWidget may not exist yet when your code runs. Check for it before you call it, or wait until it appears. The widget draws inside a closed Shadow DOM, so your page's CSS cannot style it; open it from your own button with CikutWidget.toggle().
Sign-in
Sign-in runs in a popup, and the host page stays where it is.
- The visitor clicks Sign in, or your code calls
CikutWidget.login(). - A popup opens the Cikut sign-in page, and the visitor signs in or uses an existing session.
- The popup exchanges the sign-in code for a session through the widget service, sends the result back to the page and closes.
- The chat panel opens for the signed-in visitor.
Sessions
The session is kept in an HttpOnly, Secure, SameSite=None cookie scoped to /api/widget. When the browser blocks third-party cookies, the widget sends the session in an Authorization header instead and holds it in memory, so the visitor signs in again after a reload. A session lasts 24 hours.
How messages travel
The widget never talks to the homeserver directly. It sends messages to the widget service, which relays them to the room and streams new ones back to the page with server-sent events. The room's access tokens stay on the server, so a script on your page cannot read them. Widget messages are not end-to-end encrypted. With data-agent-id set, the panel shows the one direct room with that agent, and the agent receives the messages as a member of that room.
Authenticated requests are limited to 200 per minute for each visitor's IP address.
Troubleshooting
| What you see | Cause | What to do |
|---|---|---|
| The widget does not appear | The script returned 404, or data-api-key is missing or invalid | Check the status at the top of this page, then the browser console for [CikutWidget] warnings. |
| "Origin not allowed" | The page's domain is not on the key's list | Ask us to add the domain to the key. |
| "Popup was blocked" | The browser blocked the sign-in popup | Allow popups for the site, or call CikutWidget.login() from a click handler. |
| Signed out after a reload | The browser blocks third-party cookies | The visitor signs in again. This is expected. |
| "Session not valid for this API key" | The session was created with a different key | Sign out and sign in again with the page's key. |