Widget Installation

The Awentail chat widget is a lightweight, embeddable component. One script tag — no dependencies, no build tools.

Basic installation

Copy this script tag and paste it before the closing </body> tag on your website:

<script
  src="https://app.awentail.com/widget.js"
  data-bot-id="your-bot-id"
  data-api-url="https://app.awentail.com"
  defer>
</script>

Replace your-bot-id with your assistant ID (found in your assistant settings → Widget tab).

Branding configuration

Most visual customization lives in your account, not in the script tag — the widget fetches your configuration on load and caches it in the browser for instant subsequent visits.

Configure these in Bot detailWidget:

Changes apply immediately to every site running the widget — no re-deploy needed.

Widget customization

Optional script attributes

AttributeDefaultDescription
data-bot-id(required)Your assistant ID
data-api-url(required)API base URL — use https://app.awentail.com
data-theme(from settings)Override theme: light, dark, or auto
data-bubble-label(none)Pill-style label on the bubble (e.g. Assistant)
data-proactive-message(none)Open the widget after a delay with this preview message
data-proactive-delay10Seconds before the proactive message appears

Example with proactive message

<script
  src="https://app.awentail.com/widget.js"
  data-bot-id="abc123"
  data-api-url="https://app.awentail.com"
  data-theme="auto"
  data-bubble-label="Ask us anything"
  data-proactive-message="👋 Need help finding something?"
  data-proactive-delay="15"
  defer>
</script>

Live conversations

Session persistence

The widget persists conversations in localStorage per assistant ID. If a visitor leaves and comes back, their chat history is preserved. Different assistants on the same site maintain separate conversations.

Styling isolation

The widget renders in an isolated container with scoped CSS, so it won’t conflict with your site’s styles. Brand color is applied programmatically — no !important overrides needed.

Multiple assistants

Embed multiple assistants on a single page with multiple script tags:

<script src="https://app.awentail.com/widget.js" data-bot-id="sales-bot" data-api-url="https://app.awentail.com" defer></script>
<script src="https://app.awentail.com/widget.js" data-bot-id="support-bot" data-api-url="https://app.awentail.com" defer></script>

Each renders its own bubble (one on the left, one on the right if positioned differently).

Performance

Troubleshooting

Widget doesn’t appear. Open DevTools → Console. The widget logs an error if data-bot-id or data-api-url is missing or invalid. Check that the bot exists in your account and the API URL is exactly https://app.awentail.com.

Wrong branding. Check Bot detailWidget in your account — those settings are the source of truth. Clear the visitor’s localStorage if they’re seeing old cached config (only matters for the visitor’s own browser).

Two bubbles showing. Your snippet is being loaded twice. The guard prevents duplicates, but on SPA route changes the widget may have already initialized — make sure the snippet runs only once per page load.