@enegelai/bot-widget
v1.30.0
Published
Enegel.ai Bot Widget
Readme
Enegel.ai Bot Widget
URLs
https://unpkg.com/@enegelai/bot-widget/dist/enegelaibot.css https://unpkg.com/@enegelai/bot-widget/dist/enegelaibot.umd.js https://unpkg.com/@enegelai/bot-widget/dist/livekit-client.esm.mjs https://unpkg.com/@enegelai/bot-widget/dist/livekit-client.esm.mjs.map
When self-hosting enegelaibot.umd.js, host livekit-client.esm.mjs in the same directory so LiveKit voice transport can lazy-load it. If the asset must live elsewhere, set globalThis.ENEGELAI_LIVEKIT_CLIENT_URL before voice starts. Because the asset is loaded with browser module import(), cross-origin hosting must serve it with CORS headers such as Access-Control-Allow-Origin.
Public documentation
These docs explain how to enable and configure the Bot Widget for your website.
https://docs.c7o.ai/docs/documentation/bots/enable-bot https://docs.c7o.ai/docs/documentation/bots/enable-bot-shopify-store
Authenticated widgets (P16.1)
Current public bot settings expose authentication: {platformOrigin} for
protected widgets. The chat runtime derives this origin from its configured SSO
issuer. The Widget validates the returned origin and uses it for login, token
exchange, logout and popup callbacks. The same bundle works across environments;
no Widget build variable or customer web-server configuration is required.
Roll out the runtime settings response before the updated Widget. Missing or
malformed protected metadata fails closed, and an issuer change clears credentials
from the previous scope. Fresh settings gate content and startup activity;
login opens a popup synchronously and exchanges a PKCE code at the isolated
/api/v2/sso issuer. Host applications can call setAuthenticationToken(token)
before login or logoutAuthentication() for explicit local cleanup and revocation.
The controller in src/service/widget-authentication.ts coordinates exactly two
fixed localStorage records through Web Locks. Rotating refresh is removed before
network dispatch and its verified successor is stored before exposing an access
token. Only memory holds JWTs. Each protected socket attempt obtains a fresh
one-use ticket. Logout/authentication loss fences delayed work; unsent content is
discarded with a visible status. A displaced tab pauses until Continue in this
tab or reload. Reset keeps the Grant and allocates a new interaction suffix.
Browser restart restoration requires the same profile/origin/scope, valid stored
records and a live Grant. safe-storage.ts and existing cb__* decorators remain
unchanged: ordinary transcript/context persistence is not isolation between people
or tabs. Protected authentication requires writable localStorage and Web Locks;
anonymous widgets retain their existing storage fallback behavior.
Implementation awaits manual acceptance and coordinated platform/runtime release.
The CXM P16.1 design and platform docs/widget-sso-operations.md describe the full
contract, deployment order and real identity-provider verification requirements.
