Skip to content

Widget

The AdaptCX widget is an embeddable chat surface — a <script> snippet you paste into your website's HTML that renders a chat bubble in the corner of every page. End-users talk to your bot through the widget; you never expose the internal portals to them.

Sections

Where the widget is served

Every tenant gets its own widget host: widget.<your-org>.<env>.adaptcx.ai. The .js and .css files are served from there — cached at the edge (Cloud CDN), fast to load.

Global namespace

The widget attaches itself to window.adaptcx. Method names live under that global:

javascript
window.adaptcx.init(config)
window.adaptcx.open()
window.adaptcx.close()
window.adaptcx.sendMessage("hello")

TIP

window.adaptcx is the canonical global. window.omnibot continues to work as a backward-compat alias pointing at the same object — existing embeds from before the rename don't need to be updated.

Async script loading

If you're loading the widget script async (which you should for performance), commands issued before the script loads are queued via window.adaptcxQueue and replay on load:

html
<script>
  window.adaptcxQueue = window.adaptcxQueue || [];
  window.adaptcxQueue.push(['init', { deploymentKey: 'your-key' }]);
  window.adaptcxQueue.push(['setContext', { page: 'checkout' }]);
</script>
<script async src="https://widget.<your-org>.<env>.adaptcx.ai/widget.iife.js"></script>

Once the widget loads, it replays the queue in order.

What the widget does under the hood

  • Loads the widget JS bundle (~250 KB gzipped) from your tenant's CDN endpoint
  • Opens a WebSocket to api.<your-org>.<env>.adaptcx.ai to stream messages
  • Renders bot responses inline as they stream (character-by-character or chunk-by-chunk depending on the bot)
  • Maintains a session state — refreshing the page continues the same conversation until a session timeout

What it doesn't do

  • Store personally identifiable data in localStorage
  • Track the user across sites (no cookies beyond the session)
  • Load third-party analytics or trackers

See also

AdaptCX — product documentation