Ways to put the dialer in
Script tag, React component, plain iframe, hosted link or headless: what each needs, and which to pick.
Every approach uses the same two server calls: a seat for each user who dials, and a one-use session each time the dialer opens. They differ only in how the dialer reaches the screen.
const DS = 'https://api.dialerseat.com/v1'
const headers = { Authorization: `Bearer ${process.env.DIALERSEAT_SECRET_KEY}`, 'Content-Type': 'application/json' }
const seat = await fetch(`${DS}/seats`, { method: 'POST', headers,
body: JSON.stringify({ external_user_id: user.id, email: user.email, name: user.name }) }).then(r => r.json())
const { token } = await fetch(`${DS}/seats/${seat.id}/sessions`, { method: 'POST', headers,
body: JSON.stringify({ campaign: 'crm_campaign_77', leads }) }).then(r => r.json())Script tag (most apps)
One script and a div. The dialer mounts itself, takes leads from the page, and sends browser events back to your page. Allow your domains under Miniplayer. About ten minutes.
React component
The same script, wrapped in a small component that loads it once and mounts with a fresh session. The console's Setup page has the component ready to copy.
Plain iframe
For pages that cannot load third-party scripts (strict CSP, page builders, older apps). Point an iframe at https://dev.dialerseat.com/embed/dialer?k=YOUR_PUBLISHABLE_KEY#s=SESSION_TOKEN with allow="microphone; autoplay". Send the leads with the session. To hear events in the page, listen for message events from https://dev.dialerseat.com.
Hosted dialer link
The fastest start: a button that opens the dialer in its own window. Nothing to embed and no origin to allow. Leads travel with the session; results reach you by webhook.
Headless, and components
Your own interface, no DialerSeat screen. DialerSeat.connect({ session, leads }) runs the dialer invisibly on your page: it holds the phone line, places the calls and sends every webhook, while your page draws from its state and drives it with dialer.start(), dialer.hangup(), dialer.disposition() and the rest. Or place only the parts you want. See Components and headless.
Which to pick
- A web app you control: script tag, or the React component if you use React.
- A page that blocks third-party scripts: plain iframe.
- No front-end time this week: hosted link.
- You are building your own dialer screen: headless, or the components you want where you want them.
- A plain HTML page with no JavaScript of your own: the <dialerseat-dialer> tag (see the tutorial).
In every approach
- Write results to your database from webhooks, which are signed and retried. Browser events are for your interface only.
- Report each signup and renewal (
POST /v1/subscriptionsor Stripe forwarding) so seats stay active for the days paid for. - Skip is always the last disposition; it arrives as code SKIP.
Related:Quickstart, Tutorial: an HTML dialer, from nothing to paid, Developer accounts and Authentication and API keys.