> ## 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.

# Test your widget

> Open a hosted preview of your Phone widget and place an end-to-end call before embedding.

Validate the call experience before embedding anywhere. **Test widget** opens a hosted preview that runs your widget against the selected environment: same agent, same audio path, same call experience as production. Use it for internal testing, customer demos, or stakeholder sign-off.

> [!NOTE]
>
> Test widget is currently a **Phone widget** feature. Chat widgets use the in-editor live preview to validate styling and copy before publishing.

![Web Calling widget showing the consent screen and an active call side by side](https://mintcdn.com/polyai/qUzW3UML6Ru8OVcR/images/widgets/test-widget-preview.png?fit=max\&auto=format\&n=qUzW3UML6Ru8OVcR\&q=85\&s=4c97bd5e7e2dea335d686d6ba198a9eb)

Widget consent screen and active call

## Opening the test widget

1. Open your Phone widget in **Widgets**.
2. In the right-hand preview panel, click **Test widget ↗**.
3. A new tab opens with a blank page hosting only your widget.

The preview token is valid for **1 hour**. Refresh the test page if it expires.

## Walking through a call

**1. Click the launcher**

The launcher renders in the bottom-right of the test page. Click it to open the widget.

**2. Review the call-start screen**

The widget shows your welcome message, the disclaimer (if enabled), and a primary **Start call** button using your brand color.

**3. Start the call**

Click **Start call**. The browser prompts for microphone access. Click **Allow**.

**4. Connecting**

The widget shows **Connecting…** while it opens a WebSocket to PolyAI's WebRTC gateway and negotiates audio.

**5. In call**

Your agent answers and the widget switches to **In call**. A timer starts and the **Mute** button appears. Speak normally to test the conversation flow.

**6. End the call**

Click **End call** (or hang up from your agent's side). The widget shows **Call ended** and a **Start new call** button.

## What to verify

* **Branding.** Header text, logo, agent name, and primary color match your brand.
* **Welcome and CTA copy.** Read out loud to check tone.
* **Disclaimer placement.** Disclaimer appears above **Start call**, with policy links rendered as inline hyperlinks.
* **Audio quality.** Speak and listen for latency, dropouts, or distortion. Web Calling uses Opus 48 kHz stereo.
* **Mute / unmute.** Mute mid-call, confirm the agent can't hear you, then unmute.
* **Call recovery.** Let the call end, then click **Start new call** to confirm clean reconnection.

## Microphone permission

The first time a visitor clicks **Start call** on a given origin, the browser prompts for microphone access. Web Calling handles three outcomes:

| Visitor action | Widget behavior |
| - | - |
| Allow | Call connects normally. |
| Block | Widget shows a **Mic blocked** state with steps to re-enable mic permissions and a **Try again** button. |
| Dismiss | Widget returns to the call-start screen so the visitor can try again. |

> [!TIP]
>
> The preview runs on a PolyAI origin, so mic permission granted here doesn't carry over to your site.

## Sharing a preview

The preview URL is shareable. Send it to stakeholders, customers, or your wider team to validate the experience together, no embed required. Best for internal testing, customer demos, early stakeholder review, and fast validation before website deployment.

A few things to know about how the link behaves:

* The token is valid for **1 hour**. Generate a fresh one from the editor when you need to extend a session.
* Anyone with the link can place a call against the configured environment, so point the widget at **Staging** for share-outs unless you specifically want stakeholders on **Live**. Sandbox has no widget connection, so test a Branch in Sandbox over an in-app call instead.
* Calls placed via the preview count against your usage just like calls on Live.

## Troubleshooting the test

If the test fails, see [Troubleshooting](https://docs.poly.ai/widgets/troubleshooting.md). The most common issues:

* **Browser blocks microphone.** Check the address-bar lock icon and re-allow.
* **HTTPS required.** The preview is always HTTPS, but if you embed the widget on an `http://` site the launcher is disabled.
* **Stuck on Connecting…** Usually a network/firewall issue blocking WebRTC.
* **No audio after connect.** Check OS-level mic and speaker permissions.

## Next steps

> [card] [Install on your site](https://docs.poly.ai/widgets/install.md)
>
> Embed the script on your live site once the test passes.

> [card] [Troubleshooting](https://docs.poly.ai/widgets/troubleshooting.md)
>
> Mic, network, and call-quality issues.
