# Web chat widget (/luso8/inbox/web-chat-widget)

> Add a branded chat widget to your website, connect an AI agent to answer visitors, and hand conversations to your team.

The web chat widget puts a chat window on your own website. Visitors can ask questions any time and get answers from an [AI agent](/luso8/agents) grounded in your knowledge, read your help articles, and reach your team when they need a person. Conversations appear in **Support → Conversations**.

Set it up under **Support → Embed bot**.

## Create a widget [#create-a-widget]

1. Open **Support → Embed bot** and choose **New widget**.
2. Work through the configuration tabs below. The preview updates as you go.
3. Copy the embed code and add it to your site.

You can create several widgets, for example one per website or brand.

## Configure the widget [#configure-the-widget]

<Tabs items={["Appearance","Content","Agent","Help","Security"]}>
<Tab value="Appearance">
- **Name** of the widget (for your team).
- **Size** of the chat window.
- **Colors** to match your brand.
- **Position** on the page.
- **Corner radius**.
</Tab>

<Tab value="Content">
- **Company name** and **logo**.
- **Headline** shown at the top of the chat.
- **Welcome message** and **initial messages** visitors see when they open the chat.
- **Placeholder** text in the message box.
</Tab>

<Tab value="Agent">
- **Connected AI agent**: the agent that answers visitors.
- **Display name** and **avatar** for the agent.
- **Branding** and an **Active** switch to turn the widget on or off.
- **Voice notes and spoken replies**: visitors can send voice notes, and the agent can reply with audio.
- **Show transcripts to visitors**: show the text of voice messages.
- **File attachments**: let visitors send files.
</Tab>

<Tab value="Help">
Choose which help center articles appear in the widget's **Help** tab, so visitors can find answers themselves.
</Tab>

<Tab value="Security">
**Allowed domains**: the widget only loads on the domains you list and their subdomains. Leave the list empty to allow any site.
</Tab>
</Tabs>

<Callout type="warn">
Always set **Allowed domains** for a live widget. Otherwise anyone can copy your embed code onto another site.
</Callout>

## Add it to your website [#add-it-to-your-website]

The embed code is a single script tag. Add it once, before the closing `</body>` tag, on every page where the chat should appear. Replace `YOUR_WIDGET_ID` with the ID shown in the embed dialog; the dialog gives you the exact code for your widget.

<Tabs items={["HTML","React","JavaScript","WordPress"]}>
<Tab value="HTML">
```html title="index.html"
<script src="https://luso8.rexplore.ai/api/widget?id=YOUR_WIDGET_ID" async></script>
```
</Tab>

<Tab value="React">
```tsx title="app/layout.tsx"
import Script from 'next/script';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script src="https://luso8.rexplore.ai/api/widget?id=YOUR_WIDGET_ID" strategy="afterInteractive" />
      </body>
    </html>
  );
}
```

In a plain React app, add the script tag to `public/index.html` instead.
</Tab>

<Tab value="JavaScript">
```js title="chat.js"
const script = document.createElement('script');
script.src = 'https://luso8.rexplore.ai/api/widget?id=YOUR_WIDGET_ID';
script.async = true;
document.body.appendChild(script);
```
</Tab>

<Tab value="WordPress">
1. In your WordPress admin, open **Appearance → Theme File Editor**, or use a plugin that adds code to the footer.
2. Paste the script tag just before `</body>` in your theme's footer.
3. Save, then open your site to check that the chat bubble appears.

```html
<script src="https://luso8.rexplore.ai/api/widget?id=YOUR_WIDGET_ID" async></script>
```
</Tab>
</Tabs>

## Help articles [#help-articles]

Articles and FAQs you publish in **Support → Help center** can be shown in the widget's **Help** tab. Organize them in collections, keep drafts until they are ready, and use **Try search** to test what visitors will find. The help center shows views and how often an article was marked helpful. Agents use published articles too.

## What visitors can and cannot do [#what-visitors-can-and-cannot-do]

- Visitors can chat, send voice notes and files (when enabled), and read help articles.
- The widget does not support live two-way voice calls.
- Text inside images that visitors send is not read by the agent.

## When a person is needed [#when-a-person-is-needed]

The connected agent answers on its own until a teammate steps in. It hands the conversation to your team when the visitor asks for a person or when it cannot help, and a teammate can take over at any time. See [Handoff to humans](/luso8/agents/handoff).

## Related [#related]

<LinkGrid>
<LinkItem href="/luso8/guides/website-ai-agent" title="Put an AI agent on your website">
The full setup, step by step.
</LinkItem>

<LinkItem href="/luso8/agents" title="AI agents">
Create and tune the agent behind the widget.
</LinkItem>

<LinkItem href="/luso8/knowledge-base" title="Knowledge base">
Give the agent accurate answers.
</LinkItem>
</LinkGrid>