batondocs← SiteSign in
Migrating/From Twilio / metered

Migrating from Twilio / metered providers

Replace the provider's token/credential fetch with one call to Baton. The response is the standard iceServers shape, so the client side barely changes.

Swap the credential fetch

// Twilio: NTS token → token.ice_servers (snake_case, per-GB metered)
const token = await twilioClient.tokens.create();
const iceServers = token.iceServers; // provider-shaped

What changes

ConcernTwilio / meteredBaton
BillingPer-GB of relayed traffic — variable, hard to forecast.Flat monthly by concurrency tier — the bill is the same whether you relay 10 GB or 10 TB.
Response shapeProvider-specific field names.Standard iceServers array.
Relay IPsRotating pool.Stable, allowlistable IPs.
Region controlLimited.You pick the region; media stays there.

Keep the credential fetch server-side in both cases — you're replacing one server-side call with another, not changing where secrets live.