Skip to main content

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>
AttributeDescription
srcThe LUMA widget script. Always load it from LUMA so you get fixes automatically.
data-pidProject ID from the Install page
data-cidAgent ID from the Install page

What the widget does​

  1. Finds its own <script> tag and reads data-pid and data-cid.
  2. Runs the handshake and loads the agent's appearance (colors, texts, position, theme).
  3. Shows the bubble. On click, opens the chat panel (an iframe served by LUMA), full screen on mobile.
  4. Exposes window.AgentWidget so 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.