Widget & embed

Embed the Chat Widget on Any Website

5 min read

The ChatLM widget loads from a single JavaScript file. No npm install, no React bundle — just one script tag.

Step 1 — Copy from dashboard

Log in and open Dashboard. In the right sidebar you will see Embed code with your personal data-api-key.

Step 2 — Paste before </body>

Add the script on every page where visitors should see chat (or in your global footer template):

<script src="https://chatlm.tech/widget/widget.js"
  data-api-key="YOUR_KEY"
  data-base-url="https://chatlm.tech"
  defer></script>

Use defer (recommended). Do not use async unless you know the load order implications.

Step 3 — Allowed origins

In dashboard → Domain security, list each domain exactly as visitors type it in the browser, including https://.

Step 4 — Verify

  1. Hard-refresh your page (Ctrl+F5 / Cmd+Shift+R).
  2. Open an incognito window — the bubble should appear bottom-right.
  3. Send “Hello” and wait for the AI reply.

Common mistakes

  • Script placed in <head> only without footer — still works with defer, but footer is safer.
  • Wrong API key copied from another account.
  • Staging domain not added to allowed origins.

WordPress guide · Troubleshooting

Ready to set up your widget?