v1.5.1 — The chat script tag now works anywhere on the page

1.5.1Bug fixDenis Povarov

A small release for everyone running the AI chat widget from a <script> tag.

Fixed: the async tag crashed when placed in <head>

The install snippet uses async, which lets the browser run the script as soon as it downloads — sometimes before <body> exists. In that window the widget tried to attach itself to a body that was not there yet and failed silently: no launcher, no error a visitor would see, and it depended on network timing, so it could work on one machine and not another.

The widget now waits for the page to be ready before it mounts. Paste the snippet in the <head> or before </body> — both work.

New: call the API before the script has loaded

async had a second consequence: an inline script right after the tag could not rely on window.KookeeChat existing yet. The documented workaround was to wait for the load event.

The widget now replays calls queued by a small stub placed before the tag — the same pattern the consent script already uses. Put the stub on the page and call KookeeChat.init(), open(), on() and the rest from anywhere, in any order; they run the moment the script arrives. A queued init() takes precedence over data-* attributes on the tag.

The Programmatic control snippet on the project's AI Chat page in the dashboard now includes the stub, and Control the chat widget from JavaScript in the help center covers the details.

Packages

@kookee/react 1.5.1 carries the fix; @kookee/sdk 1.5.1 is a version-only release to stay in step. The hosted chat/latest.js is already updated — sites using it need no action.