> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure widget

> Brand your widget, write the copy, set up consent. One editor for Phone and Chat.

<div className="simplified-only">
  Build a Web Calling widget that matches your brand and ship it from **Configure > Web Calling** in Agent Studio. Three tabs: **Styling**, **Content**, **Embed**. The right rail has a live preview that updates as you type.

  ## Create the widget

  From **Configure > Web Calling**, click **Add widget** to open the dialog. Fill in:

  <ParamField path="Widget name" type="string" required>
    Identifies this widget. Example: "Main website" or "Support page".
  </ParamField>

  <ParamField path="Website URL" type="string" required>
    The domain where this widget will load. The widget only renders on this origin; embed attempts from other domains are ignored.
  </ParamField>

  <ParamField path="Variant" type="dropdown" required>
    The agent variant this widget connects to.
  </ParamField>

  <ParamField path="Environment" type="dropdown" required>
    Sandbox or Live. You can promote between them without re-embedding.
  </ParamField>

  Click **Add** to create the widget. You'll land in the editor.

  ## Styling

  Match the widget to your brand.

  <Frame caption="Styling tab in Configure > Web Calling with live preview">
    <img src="https://mintcdn.com/polyai/qUzW3UML6Ru8OVcR/images/widgets/op-styling.png?fit=max&auto=format&n=qUzW3UML6Ru8OVcR&q=85&s=c6c578a26919794e9bad3ab6f294f005" alt="Widget editor Styling tab showing Agent name field, Color theme toggle, and a live preview of the widget" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="3010" height="1606" data-path="images/widgets/op-styling.png" />
  </Frame>

  <ParamField path="Agent name" type="string">
    Display name for the agent (defaults to the variant's agent). Used in the call card. 1 to 50 characters. Example: "Emily".
  </ParamField>

  <ParamField path="Color theme" type="dropdown">
    Choose between **Dark** or **Light**. This controls the widget background, animation, and buttons. Stored as `theme_color` on the configuration.
  </ParamField>

  <Tip>
    The launcher is a 60 px circle on desktop, 44 px on mobile. Check contrast against its white iconography to keep the call button legible.
  </Tip>

  ## Content

  Write the copy your visitor sees when they open the widget: welcome line, CTA labels, and your disclaimer.

  <Frame caption="Content tab with disclaimers enabled and consent preview">
    <img src="https://mintcdn.com/polyai/qUzW3UML6Ru8OVcR/images/widgets/content-tab.png?fit=max&auto=format&n=qUzW3UML6Ru8OVcR&q=85&s=1fceb8d8c59a412eb200ab9d79fa55cf" alt="Widget editor Content tab showing disclaimer message, company policies, and a live preview with consent button" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="3006" height="1620" data-path="images/widgets/content-tab.png" />
  </Frame>

  <ParamField path="Welcome message" type="string">
    Shown on the call-start screen. Defaults to "Hi I'm \[agent name], how can I help today?". Up to 100 characters.
  </ParamField>

  <ParamField path="Start call label" type="string">
    Primary CTA the visitor clicks to begin a call. Defaults to "Start call". Up to 100 characters.
  </ParamField>

  <ParamField path="End call label" type="string">
    Label on the in-call hang-up button. Defaults to "End call". Up to 100 characters.
  </ParamField>

  <Note>
    Transient call-state strings ("Connecting…", "In call", "Mute", "Unmute", "Call ended", "Start new call", and the generic error message) aren't editable in v1. Submit a feature request if you need to localize them.
  </Note>

  ### Disclaimer and consent

  Privacy disclaimer and consent controls are off by default and easy to switch on when you need them.

  <Warning>
    Review your transparency, disclosure, and consent requirements carefully before launch. Meeting those requirements in every jurisdiction you operate in is your responsibility, particularly for EU customers and some US states.
  </Warning>

  <ParamField path="Enable disclaimer" type="boolean">
    Render the disclaimer. When enabled, both policy URLs below become required.
  </ParamField>

  <ParamField path="Disclaimer message" type="string">
    Shown to visitors before they start a call. Up to 500 characters. Supports the inline link variables `\{{privacyPolicyUrl}}` and `\{{termsUrl}}`, replaced with the URLs you configure under **Company policies**.

    Default: *"By starting this call, you agree to our Privacy Policy and Terms."*
  </ParamField>

  <ParamField path="Privacy policy URL" type="string">
    Required when the disclaimer is enabled. Must be `https://`. Example: `https://example.com/privacy`.
  </ParamField>

  <ParamField path="Terms & conditions URL" type="string">
    Required when the disclaimer is enabled. Must be `https://`. Example: `https://example.com/terms`.
  </ParamField>

  ## Embed

  When you're happy with the widget, the **Embed** tab gives you a copyable script tag. Paste it before `</body>` on your site and you're live. See [Install on your site](/widgets/install).

  <Frame caption="Embed tab with script tag and publish status">
    <img src="https://mintcdn.com/polyai/qUzW3UML6Ru8OVcR/images/widgets/embed-tab.png?fit=max&auto=format&n=qUzW3UML6Ru8OVcR&q=85&s=8ffbbd714fb4aa7ae12f9013a76710a6" alt="Embed tab showing the copyable script tag and publish status" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2492" height="1502" data-path="images/widgets/embed-tab.png" />
  </Frame>

  The Embed tab shows:

  * **Status**: Live, Draft, or Archived.
  * **Script tag**: paste before `</body>` on your site.
  * **Last published**: timestamp of the most recent publish to this environment.
  * **Snippet changed** banner: appears when the published script tag differs from the current draft (your dev team needs to re-embed).

  ## Save and publish

  The publish button lives in the top-right of the editor:

  1. Edits save locally as you type and reflect in the live preview.
  2. Click **Save and publish** to deploy to the selected environment.
  3. A confirmation modal asks you to confirm.
  4. A bottom-right toast confirms "Widget published".

  If you change the script tag (for example by switching variants), the Embed tab shows a snippet-changed warning so you can hand the new tag to your dev team.

  ## Multiple widgets

  You can run more than one widget per project. Each gets its own branding and policies. Common patterns:

  * **Per domain** : different branding for `example.com` and `support.example.com`.
  * **Per region** : a UK widget on a UK variant, a US widget on a US variant.
  * **Per environment** : isolate a Sandbox widget for QA from your Live widget.

  ## Next steps

  <CardGroup cols={2}>
    <Card title="Install on your site" href="/widgets/install" icon="code">
      Embed the script via direct HTML or Tag Manager.
    </Card>

    <Card title="Test your widget" href="/widgets/test" icon="circle-play">
      Hosted preview for stakeholder review.
    </Card>
  </CardGroup>
</div>

<div className="full-only">
  Build a widget that matches your brand and ship it from a single editor in Agent Studio. The editor is the same whether you're configuring a Phone or Chat widget. Differences are called out inline.

  ## Creating a widget

  From **Configure > Web Calling**, click **Add widget** to open the **Add widget** dialog. (When no widgets exist yet, the page shows an empty state with the same button.)

  The dialog asks you to pick a **Widget type** first (**Phone** for Web Calling, **Chat** for Webchat), then fill in:

  <ParamField path="Widget name" type="string" required>
    A name to identify this widget (e.g., "Main website", "Support landing page").
  </ParamField>

  <ParamField path="Website URL" type="string" required>
    The domain where this widget will load. The widget only renders on this origin. Embed attempts from other domains are ignored.
  </ParamField>

  <ParamField path="Variant" type="dropdown" required>
    The [variant](/variant-management/introduction) this widget connects to. Use variants for location-specific or A/B-tested deployments.
  </ParamField>

  <ParamField path="Environment" type="dropdown" required>
    Sandbox<span className="full-only">, Pre-release,</span> or Live. You can promote a widget through environments without re-embedding.
  </ParamField>

  Click **Add** to create the widget. You'll land in the editor.

  <Tip>
    The **Chat** widget type is disabled until you've completed [Chat configuration](/webchat/chat-configuration). **Phone** widgets are available out of the box, no chat agent required.
  </Tip>

  ## Widget editor

  The editor has three tabs: **Styling**, **Content**, and **Embed**. A live preview panel on the right updates as you type.

  ### Header controls

  * **Widget selector**: switch between widgets in this project.
  * **Widget type indicator**: shows whether you're editing a Phone or Chat widget. Set at creation, can't be changed later.
  * **Save and publish**: deploy changes to the selected environment.
  * **Unpublished changes** indicator: appears when the widget has unsaved or unpublished edits.

  ## Styling tab

  Match the widget to your brand. Some controls are shared, others are type-specific. The editor only shows the fields that apply to the widget you're editing.

  <Frame caption="Styling tab with agent name and color theme controls">
    <img src="https://mintcdn.com/polyai/qUzW3UML6Ru8OVcR/images/widgets/styling-tab.png?fit=max&auto=format&n=qUzW3UML6Ru8OVcR&q=85&s=340371056886c2e46682e9023fd4372a" alt="Widget editor Styling tab with agent name and color theme controls" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2494" height="1624" data-path="images/widgets/styling-tab.png" />
  </Frame>

  ### Shared

  <ParamField path="Agent name" type="string">
    Display name for the agent (defaults to the variant's agent). Used in both the call card (Phone) and the chat header / message rows (Chat). 1 to 50 characters. Example: "Emily".
  </ParamField>

  <Tip>
    The launcher is a 60 px circle on desktop, 44 px on mobile. Check contrast against its white iconography to keep the call/chat button legible.
  </Tip>

  ### Phone-only

  <ParamField path="Color theme" type="dropdown">
    Choose between **Dark** or **Light**. This controls the widget background, animation, and buttons. Stored as `theme_color` (`"dark"` or `"light"`) on the Web Calling configuration. Custom hex values aren't supported in v1.
  </ParamField>

  ### Chat-only

  These fields appear only when the widget type is **Chat**:

  <ParamField path="Primary color" type="string">
    Accent color for suggestion bubbles, the widget button, header, and user chat bubbles. Enter a hex code. Example: `#c3da28`. Stored as `color` on the Webchat configuration.
  </ParamField>

  <ParamField path="Header text" type="string">
    The title shown in the chat header. Use your brand or product name. Example: "Acme Support".
  </ParamField>

  <ParamField path="Header image" type="file">
    Optional. Logo or wordmark for the chat header. JPEG / JPG / PNG up to 2 MB. Min. 400 × 100 px (recommended 800 × 200 px). Choose a fit option of **Fit** (preserve aspect ratio) or **Fill** (crop to frame).
  </ParamField>

  <ParamField path="Agent image" type="file">
    Optional. Avatar shown alongside agent messages. JPEG / JPG / PNG / static GIF up to 1 MB. Min. 128 × 128 px (recommended 256 × 256 px). Same Fit / Fill options.
  </ParamField>

  <Note>
    Phone widgets don't render a header logo or agent avatar. The call card is intentionally minimal so the focus stays on the live audio. Use the agent name and primary color to brand it.
  </Note>

  ## Content tab

  Write the copy your visitor sees when they open the widget: welcome message, CTAs, and your disclaimer.

  <Frame caption="Content tab with disclaimers and consent preview">
    <img src="https://mintcdn.com/polyai/qUzW3UML6Ru8OVcR/images/widgets/content-tab.png?fit=max&auto=format&n=qUzW3UML6Ru8OVcR&q=85&s=1fceb8d8c59a412eb200ab9d79fa55cf" alt="Widget editor Content tab showing disclaimer message, company policies, and live consent preview" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="3006" height="1620" data-path="images/widgets/content-tab.png" />
  </Frame>

  ### Welcome message

  <ParamField path="Welcome message" type="string">
    Shown on the widget's start screen. Phone widgets default to "Hi I'm \[agent name], how can I help today?". For Chat, the conversation greeting comes from the agent's [chat configuration](/webchat/chat-configuration), not the widget. Up to 100 characters.
  </ParamField>

  ### Phone-only: call-to-action labels

  <ParamField path="Start call label" type="string">
    Primary CTA the visitor clicks to begin a call. Defaults to "Start call". Up to 100 characters.
  </ParamField>

  <ParamField path="End call label" type="string">
    Label on the in-call hang-up button. Defaults to "End call". Up to 100 characters.
  </ParamField>

  <Note>
    For Phone widgets, transient call-state strings ("Connecting…", "In call", "Mute", "Unmute", "Call ended", "Start new call", and the generic error message) are not editable in v1. Submit a feature request if you need to localize them.
  </Note>

  ### Disclaimer and consent

  PolyAI gives you optional controls for privacy disclaimer and consent. They're off by default and easy to switch on when you need them.

  <Warning>
    Review your transparency, disclosure, and consent requirements carefully before launch. Meeting those requirements in every jurisdiction you operate in is your responsibility, particularly for EU customers and some US states.
  </Warning>

  <ParamField path="Enable disclaimer" type="boolean">
    Toggle to render the disclaimer. When enabled, both policy URLs below become required.
  </ParamField>

  <ParamField path="Disclaimer message" type="string">
    Shown to visitors before they start. Up to 500 characters. Supports the inline link variables `\{{privacyPolicyUrl}}` and `\{{termsUrl}}`, which are replaced with the URLs you configure under **Company policies**.

    Phone default: *"By starting this call, you agree to our Privacy Policy and Terms."*\
    Chat default: *"This is an AI-powered system and responses should be verified. All chats are recorded in order to respond to your query and for training and quality control purposes."*
  </ParamField>

  <ParamField path="Enable consent button" type="boolean">
    **Chat widgets only.** When enabled, users must click "I consent and start chat" before the conversation begins.
  </ParamField>

  ### Company policies

  <ParamField path="Privacy policy URL" type="string">
    Required when the disclaimer is enabled. Must be `https://`. Example: `https://example.com/privacy`.
  </ParamField>

  <ParamField path="Terms & conditions URL" type="string">
    Required when the disclaimer is enabled. Must be `https://`. Example: `https://example.com/terms`.
  </ParamField>

  ### Chat-only: launcher and behavior

  Chat widgets expose extra runtime controls that don't apply to Phone:

  | Control              | Where it's set                                                                                     | Effect                                                                                                         |
  | -------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
  | Render mode          | Editor + `data-render-mode` script attribute                                                       | `default` (floating launcher + panel) or `fullscreen` (chat fills the viewport, launcher hidden).              |
  | Auto-open            | `data-auto-open="true"` on the script tag                                                          | Opens the chat as soon as the widget initializes. Useful for dedicated chat pages.                             |
  | Show / hide launcher | `data-show-icon="false"` on the script tag, plus `WebchatAPI.showIcon()` / `hideIcon()` at runtime | Use to hook up a custom trigger button on your site.                                                           |
  | Header visibility    | `data-show-header` on the script tag, plus per-element flags in `visibilityConfig`                 | Show or hide the header, minimize button, close button, privacy link, terms link, and "Start new chat" button. |
  | Prompt bubble        | Default text + background color in the editor; runtime calls via `WebchatAPI.showBubble({...})`    | Shows a speech bubble next to the launcher to draw attention or run a campaign.                                |
  | Launcher animation   | `WebchatAPI.animateIcon({ type, durationMs })`                                                     | One of `bounce`, `grow`, `pulse`.                                                                              |
  | iOS WebView          | `data-platform="ios"` on the script tag                                                            | Forces fullscreen and hides the header so the chat looks native inside `WKWebView`.                            |

  Phone widgets don't have these knobs. The launcher renders with a fixed size, the call card is fullscreen on mobile only, and behavior is driven by call state rather than host-page config. See [Install on your site](/widgets/install) for the full script-tag attribute reference.

  ## Embed tab

  When you're happy with the widget, the **Embed** tab gives you a copyable script tag plus deployment guidance. Paste it into your site and you're live.

  <Frame caption="Embed tab with script tag and publish status">
    <img src="https://mintcdn.com/polyai/qUzW3UML6Ru8OVcR/images/widgets/embed-tab.png?fit=max&auto=format&n=qUzW3UML6Ru8OVcR&q=85&s=8ffbbd714fb4aa7ae12f9013a76710a6" alt="Embed tab showing the copyable script tag and publish status" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2492" height="1502" data-path="images/widgets/embed-tab.png" />
  </Frame>

  The Embed tab shows:

  * **Status**: Live, Draft, or Archived.
  * **Script tag**: paste before `</body>` on your site. See [Install on your site](/widgets/install).
  * **Last published**: timestamp of the most recent publish to this environment.
  * **Snippet changed** banner: appears when the published script tag differs from the current draft (your dev team needs to re-embed).

  ## Saving and publishing

  The publish button lives in the top-right of the editor. Widgets follow a draft → published lifecycle:

  1. Edits are saved locally as you type and reflected in the live preview immediately.
  2. Click **Save and publish** to deploy to the selected environment.
  3. A confirmation modal asks you to confirm. Click **Publish**.
  4. A bottom-right toast confirms "Widget published".
  5. The **Unpublished changes** indicator clears.

  If you change the script tag (for example by switching variants), the Embed tab shows a snippet-changed warning so you can hand the new script to your dev team.

  <Note>
    Permissions are scoped per widget type. Publishing a Phone widget requires write access on `polyphone_configurations`; publishing a Chat widget requires write access on `webchat_configurations`. Read access on the same resources controls whether the **Widget** entry appears in the sidebar. Ask your admin if you can't see the page.
  </Note>

  ## Live preview

  The right rail shows a live iframe preview that updates as you edit. Confirm copy length, brand-color contrast, and disclaimer placement before publishing without leaving the editor.

  For Phone widgets, click **Test widget** to open a hosted preview page in a new tab where you can place a real call. See [Test your widget](/widgets/test).

  ## Managing multiple widgets

  Spin up separate widgets for different domains, variants, or environments. Each gets its own branding and policies. Use the widget selector in the header to switch between them. Common patterns:

  * **Per domain**: different branding for `example.com` and `support.example.com`.
  * **Per region**: a UK widget on a UK variant, a US widget on a US variant.
  * **Per environment**: isolate a Sandbox widget for QA from your Live widget.
  * **Per type**: a Phone widget on high-intent conversion pages, a Chat widget elsewhere.

  This is how multi-brand and multi-site teams ship: one editor, many widget variants, no duplicated configuration.

  ## Next steps

  <CardGroup cols={2}>
    <Card title="Install on your site" href="/widgets/install" icon="code">
      Embed the script via direct HTML or Tag Manager.
    </Card>

    <Card title="Test your widget" href="/widgets/test" icon="circle-play">
      Hosted preview for stakeholder review.
    </Card>

    <Card title="Troubleshooting" href="/widgets/troubleshooting" icon="wrench">
      Mic, network, CSP, and rendering fixes.
    </Card>
  </CardGroup>
</div>
