Paste the snippet into any HTML file — no build step, no framework required. The widget script is async and adds zero blocking to your page load.
1

Open your HTML file

Open the HTML file (or template) that renders every page you want the widget on — typically your shared layout or index.html.
2

Paste the snippet before </body>

Add the script tag immediately before the closing </body> tag:
Replace kb_xxx with your knowledge base ID and bq_pk_... with your public client key.
3

Open the page in a browser

Load or refresh the page. You should see the “Ask AI” launcher button appear in the bottom-right corner within a moment of the page becoming interactive.
Get your keys — your knowledge base ID and public client key (bq_pk_...) are in the BeforeQuery dashboard under Knowledge Base → Integration. Create a client key there and add your site’s domain to the key’s origin allowlist so requests are accepted.
For all widget configuration options (position, color scheme, view mode, branding), see Widget reference.