Widget overview
The ChatHQ Widget is an embeddable chat interface you add to your website with a small JavaScript snippet. It uses your publishable key and loads only on allowed domains you configure.
Features
- Floating chat button and conversation panel
- Configurable position (e.g. bottom-right)
- Allowed domains — Backend enforces that the widget only loads on domains you add
- Appearance and branding options
How it works
- Publishable key — You get a publishable key from Workspace Settings → Publishable Keys. This key is safe to use in the widget snippet (it is designed for client-side use).
- Allowed domains — Add the domains where your widget may load (e.g.
example.com,www.example.com). Our backend rejects requests from domains not in this list. - Embed snippet — Add the snippet to your site. It sets
window.ChatHQ.workspace,window.ChatHQ.bot, andwindow.ChatHQ.publishableKeyto your publishable key, then loads the widget script.
How to add the widget
- Publish your assistant.
- Add your domain(s) to Allowed domains in workspace settings.
- Copy the embed snippet (see Embed code) and add it to your site before
</body>. - Replace the placeholder with your publishable key from Workspace Settings → Publishable Keys.
Important:
The widget will not load on domains that are not in your allowed domains list. Our backend validates the request origin (or Referer) against your allowed domains.
See Embed code for the exact snippet and Allowed domains for details.
Was this article helpful?
