Skip to main content

Web Calls

Web calls let your users talk to your voice agent directly from a web browser — no phone number needed. Using WebRTC, thinnestAI streams audio between the browser and your agent in real time, creating a seamless voice experience embedded in your website or app.

How Web Calls Work

No phone network is involved. Audio travels over the internet using WebRTC infrastructure powered by LiveKit.

Option 1: Drop-in Embed Widget

For the fastest integration, use the thinnestAI embed widget. It handles all WebRTC complexity, permissions, and UI automatically.

Script Tag Integration

Add this to your website:
This renders a floating call button. When clicked, it connects directly to your voice agent.

Combined Chat + Voice

To offer both text and voice on the same page, set data-widget-type to "combined":
[!NOTE] Widget appearance (colors, launcher style) can be customized from the Deploy → Design tab in your Agent Studio.

Option 2: Custom UI with the Voice SDK

If you want full control over the user interface, build a custom interface using the @thinnest-ai/voice-sdk.

Installation

Starting a Call

Handling Events

The Voice SDK emits events that you can listen to in order to update your custom UI:

React Component Example

Here is a simple React implementation using the SDK:

Option 3: Backend-to-Backend Initialization

If you don’t use the Voice SDK and prefer to get a LiveKit token from your backend to connect your own LiveKit client, you can call the underlying REST API.

Step 1: Create a Session Token

The response includes the livekit_url, room_name, and JWT token.

Step 2: Connect

Pass these parameters to your LiveKit client implementation (see WebRTC & LiveKit for examples).

Browser Compatibility

Web calls use WebRTC, which is supported by:

Microphone Permissions

The browser will prompt the user for microphone access. If access is denied, the Voice SDK emits an error event. Handle the permission denied case in your UI so the user understands why the call cannot start.

Best Practices

  1. Request microphone permission gracefully — If building a custom UI, wait until the user clicks “Call” to initialize the Voice SDK.
  2. Show visual feedback — Indicate when the agent is speaking vs. listening. Users need to know when to talk.
  3. Display a live transcript — Showing the conversation in text alongside the audio helps users follow along and improves accessibility.
  4. Test on mobile — Mobile browsers have stricter autoplay policies. Audio playback requires a user gesture (tap/click) to start, which the Drop-in Widget and Voice SDK handle for you.

Next Steps