Prerequisites
Create an agent
The agent whose prompt and voice will run the widget session. Set
widget_enabled: true (the default).Decide the routing mode
mode="agent"— one static agent per key. Simplest.mode="webhook"— your server picks the agent per visitor via acall.incomingwebhook. Use this for logged-in users, A/B tests, or per-page routing.
Create a publishable key
key starting with pk_live_.... Publishable
keys are public by design — safe to ship in your front-end bundle.
See Publishable keys reference for
all fields.
Drop the widget on your site
Three integration options are covered in the widget SDK docs:React component
<ThunderPhoneWidget publishableKey="pk_live_..." />.Headless hook
useThunderPhone() for custom UIs.CDN script tag
ThunderPhone.mount({...}) for non-bundler sites.publishableKey and render the mic button
plus the in-call audio element.
Widget-mode webhooks
Whenmode="webhook", ThunderPhone calls your webhook_url on every
session start with a call.incoming payload. Return the agent
configuration you want to run for that visitor — it follows the same
response schema as phone
calls:
Observe the sessions
Widget sessions show up inGET /v1/calls with
direction="widget" — same transcript, recording, grading, and
billing as phone calls. Filter by direction to build a widget-only
dashboard.
Next steps
Widget SDK reference
React / hook / CDN integration details.
Dynamic per-call config
Implement the
mode="webhook" flow end-to-end.Publishable keys reference
Every field on the key resource.
Mic sessions API
Skip the widget; drive LiveKit directly for custom UIs.