theme.liquid is the layout that wraps every storefront page. You paste the widget snippet into it.

Before you start

  • A website widget with your store on its Allowed origins list, for example https://yourstore.myshopify.com and your custom domain. Copy its snippet from Install → Embed snippet.

Add the widget

1

Open the theme code editor

In Shopify admin, go to Online Store → Themes. On your live theme, open the … menu and choose Edit code.
2

Open theme.liquid

It is in the Layout folder.
3

Paste the snippet before the closing body tag

theme.liquid
<script async src="https://widget.kelu.dev/kelu-widget.js"
  data-widget-id="YOUR_WIDGET_ID"
  data-client-key="kl_pk_..."></script>
</body>
Use your widget’s own snippet, or replace YOUR_WIDGET_ID and kl_pk_... with its values.
4

Save

Click Save. Each theme has its own theme.liquid, so repeat this for any other theme you publish.
Checkout pages do not use theme.liquid, so the widget does not appear there.

Check it works

Open your storefront. A round Ask AI button appears in the bottom-right corner. Ask a question and check that the answer lists its Sources. Nothing there? See Troubleshooting.