Website widget: embed code
The LUMA widget adds a chat bubble to your website. Visitors chat with your agent in a panel that opens over the page. The widget handles the handshake, the session, streaming answers, lead forms and handoff for you.
Plan: every plan. Credits: 60 per AI answer.
Add the widget
Copy the code from the agent's Install page in the LUMA app, or use this template, and paste it just before
</body> on every page where the chat should appear:
<script
src="https://luma.itechintl.com/embed/agent-widget.js"
data-pid="PROJECT_ID"
data-cid="AGENT_ID"
async
></script>
| Attribute | Description |
|---|---|
src | The LUMA widget script. Always load it from LUMA so you get fixes automatically. |
data-pid | Project ID from the Install page |
data-cid | Agent ID from the Install page |
What the widget does
- Finds its own
<script>tag and readsdata-pidanddata-cid. - Runs the handshake and loads the agent's appearance (colors, texts, position, theme).
- Shows the bubble. On click, opens the chat panel (an iframe served by LUMA), full screen on mobile.
- Exposes
window.AgentWidgetso your page can control it. See JavaScript SDK.
Appearance
Colors, position, welcome text, logo, suggested questions, lead form and the "Powered by LUMA" line are set in the app: agent, then Appearance and Advanced Settings. Changes show on your site without changing the embed code. For styling beyond the settings, see Widget CSS.
Content Security Policy
If your site sends a Content-Security-Policy header, allow LUMA:
script-src https://luma.itechintl.com;
frame-src https://luma.itechintl.com;
connect-src https://luma.itechintl.com https://api.itechintl.com;
img-src https://luma.itechintl.com https: data:;
Private agents
A private (password-protected) agent asks visitors to sign in inside the widget before chatting. Private agents are part of LUMA Elevate and Enterprise.
Remove the widget
Delete the <script> tag, or call AgentWidget.destroy() from your page.