Documentation

Help center

⌘K
The chat widgetInstall the widget
The chat widgetInstall the widget

Install the chat widget

Add the AskBrew assistant with one script tag on a website or CMS that permits custom scripts. It has no package dependency and loads asynchronously.

2 min readUpdated Jul 2026

Before you start: add at least one knowledge source and confirm your AI is live. New workspace? Open your dashboard and follow Finish setup first.

1. Copy your snippet

Open Dashboard → Chat Widget and click Get install code. Your generated snippet already includes your workspace key — there is nothing to edit.

index.html
<script src="https://app.askbrew.com/widget.js" data-key="YOUR_PUBLIC_KEY" async></script>

The public key is safe to expose — configuration and chat requests only work on domains in your Allowed websites list.

2. Paste it into your site

Place the snippet just before the closing </body> tag on every page, or once in a site-wide layout, footer, or theme template.

  1. In your Shopify admin, go to Online Store → Themes.
  2. Click ⋯ → Edit code on your live theme.
  3. Open theme.liquid and paste the snippet just before </body>.
  4. Click Save — the saved design is used the next time the widget loads.

3. Verify it's live

Refresh your published site and look for the chat bubble. Once AskBrew receives a valid configuration request, the Chat Widget page changes its status to Installation detected.

Not seeing it? Confirm the domain is in Allowed websites, refresh the page, and check that the snippet is inside <body>, not <head>.

4. Identify signed-in customers (optional)

If your website already knows the signed-in customer, call AskBrew.identify(...). The assistant will reuse those details during a support handoff, and their identity will appear with the conversation and customer request.

window.AskBrew = window.AskBrew || {}; window.AskBrew.identify = window.AskBrew.identify || function (profile) { window.AskBrew.identity = profile; }; window.AskBrew.identify({ name: "Olivia Bennett", email: "olivia@example.com", customerId: "cus_123", traits: { plan: "pro" } });

Place this before or after the widget script. Re-run it whenever the signed-in customer changes, and call AskBrew.resetIdentity() on logout after the widget has loaded. Traits accept up to ten short string, number, or boolean values.

Next steps

Was this page helpful?