Widget documentation

Widget version 1, served from /widget/v1/. Checked against the widget's source on 2 November 2026.

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.

AttributeDefaultWhat it sets
data-api-keynone, requiredYour widget key, starting with wk_.
data-agent-idnoneThe 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-themeautolight, dark or auto, which follows the visitor's system setting.
data-positionbottom-rightbottom-right or bottom-left.
data-primary-color#C43824The hex color of the button and accents.
data-titleChatThe header of the chat panel.
data-welcome-messagenoneA line shown before the conversation starts.
data-localeenThe 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.

  1. The visitor clicks Sign in, or your code calls CikutWidget.login().
  2. A popup opens the Cikut sign-in page, and the visitor signs in or uses an existing session.
  3. The popup exchanges the sign-in code for a session through the widget service, sends the result back to the page and closes.
  4. 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 seeCauseWhat to do
The widget does not appearThe script returned 404, or data-api-key is missing or invalidCheck 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 listAsk us to add the domain to the key.
"Popup was blocked"The browser blocked the sign-in popupAllow popups for the site, or call CikutWidget.login() from a click handler.
Signed out after a reloadThe browser blocks third-party cookiesThe visitor signs in again. This is expected.
"Session not valid for this API key"The session was created with a different keySign out and sign in again with the page's key.

Back to the widget on the Cikut home page