Website Widget
The Website Widget is an embeddable live-chat widget for your website. Visitors can start a conversation from any page, and those chats land in your unified Inbox where your AI agent replies.
Set up the widget
Section titled “Set up the widget”-
In the left sidebar, open AI Agents, then select Connect channels and pick the Website Widget card on the right side of the map. A drawer titled Website Widget opens.
-
Under Turn on Website Widget, select Turn on. Only an admin can do this.
-
Under Put the widget on your website, add your site under Allowed website domains. Enter hostnames only, such as
example.comandwww.example.com, one per line. Leave outhttps://, paths, ports, and wildcards. Then switch on Enable widget and select Save configuration.The Website Widget drawer -
Once the channel is on, the drawer lists more settings. Under Status & appearance, tune Primary color, Launcher position (e.g. Bottom right), and the Greeting message. You can also toggle the “Powered by Kasbly” label.
-
Open Embed code, copy the snippet, and paste it before the closing
</body>tag on your site. -
Open Public key & URLs to confirm the widget is Enabled and the channel is Connected to your agent. The HTTP and WebSocket endpoints the embed uses are listed here, along with deployment guidance for your web team. If your site sets a Content-Security-Policy, allow the widget script in
script-src, the API and WebSocket origins inconnect-src, and the API origin inframe-src. The chat session runs in a hidden frame on the API origin, so withoutframe-srcthe bubble appears but every visitor message stays pending.
Open the chat from your own button
Section titled “Open the chat from your own button”To open the chat from a button or link on your page, such as “Chat with us” on
your contact page, ask your web team to call open():
<button onclick="window.__kasblyWidget?.open()">Chat with us</button>open() shows the chat window, even when the launcher is collapsed or the
channel picker is showing, and leaves an already open window open. close()
closes it. Both do nothing on pages where the widget has not loaded, and open()
does nothing when Live Chat is turned off.
Sites with customer sign-in
Section titled “Sites with customer sign-in”If your customers sign in to your site, end the widget chat when they sign out. Otherwise the next person on a shared browser, such as a family computer, opens the widget and sees, and writes into, the previous customer’s conversation.
Ask your web team to call logout() from your site’s sign-out handler:
async function signOut() { // End the widget chat before the site session goes away. await window.__kasblyWidget?.logout(); await fetch('/account/sign-out', { method: 'POST', credentials: 'include' }); window.location.assign('/');}logout() ends the visitor’s session and clears the saved conversation and any
name or email they entered. The next message starts a new visitor. The ?. keeps
the handler working on pages where the widget has not loaded.
Per-page options
Section titled “Per-page options”The embed snippet sets tenantId and apiUrl. Your web team can add these
optional settings to window.__kasbly on a single page:
locale:'en'or'ar'. Sets the widget language. If you leave it out, the widget follows the page’s<html lang>.greeting: an opening line for this page only, instead of the greeting set in the dashboard.position:'bottom-left'or'bottom-right'. Moves the launcher for this page only.
<script> window.__kasbly = { tenantId: '<your tenant ID>', apiUrl: '<your API URL>', locale: 'ar', position: 'bottom-left', };</script>