Skip to content

Embedding the chat widget

The chat widget adds a floating chat button to your website, allowing visitors to ask questions and get AI-powered answers based on your content. It appears as a small button in the corner of the page and expands into a conversational interface when clicked.

Add a single script tag to your site, typically before the closing </body> tag:

<script
src="https://ai.quantcdn.io/v1/widget.js"
data-site-id="YOUR_SITE_ID"
data-position="bottom-right"
data-theme="light">
</script>

Replace YOUR_SITE_ID with your project’s site ID.

Customise the widget behaviour using data attributes on the script tag:

AttributeRequiredDefaultDescription
data-site-idYesYour project’s site ID
data-positionNobottom-rightWidget position: bottom-right or bottom-left
data-themeNolightColour theme: light or dark

Set data-theme="dark" to match dark-themed sites:

<script
src="https://ai.quantcdn.io/v1/widget.js"
data-site-id="YOUR_SITE_ID"
data-position="bottom-right"
data-theme="dark">
</script>

The dark theme adjusts the widget background, text colours, and input styling to suit dark user interfaces.

  • Search page — Embed a full search interface for a dedicated search page
  • Settings — Configure allowed domains and rate limits