@revdesk/sdk
Typed REST client for the v1 API: calls, SMS, phone numbers, caller IDs, caller trust, usage, and
sub-entities. Types are generated from the OpenAPI spec, so they never drift from the API.
@revdesk/webrtc
Browser-calling client. Place and receive calls in the browser through the RevDesk voice network, with one
branded surface for both connection paths.
@revdesk/sdk
Install
Command line
@revdesk/sdk includes the official revdesk CLI for scripts and one-off API requests:
npx @revdesk/sdk --help for all options. The CLI requires /v1/* paths and sends the key only
through the Authorization header.
Quickstart
AI agents
Every number you buy gets a RevDesk AI agent wired up to answer it automatically, through the dashboard or the API, the same provisioning path, no extra setup. Theagents resource lets you
discover, configure, assign, and call those agents from code.
Reading agents needs the
agents:read scope; configuring, assigning, and webCall need agents:write.
Configuring an agent requires a user-scoped key.Bounded client tokens
Mint a short-lived, number-restricted token on your server, then hand it to an untrusted client (mobile app, browser) in place of your API key. The client can only call within the from/to numbers you choose. See Bounded client tokens for the full model.Minting requires the
tokens:mint scope. A minted token cannot mint further tokens.Pagination
Cursor-paginated endpoints exposelistAll(), an async iterator that walks every page for you:
listAll() is available on phoneNumbers, agents, subEntities, and callerTrust.reputation.numbers.
Idempotency
Mutating calls accept anidempotencyKey so a retried request is processed once:
Errors
Every non-2xx response throws a typedRevDeskError:
RevDeskError shape.
@revdesk/webrtc
Install
@revdesk/sdk, then hand it to the browser client. Both
clients emit the same callUpdate / error / ended events, so your UI doesn’t change when you
switch paths. See Choosing a calling path for the differences.
Browser-direct — RevDeskRTC
reconnecting as an in-progress call: the client is restoring media after a network or
native call-audio interruption. Do not tear the call down; it returns to active when audio is ready.
During initial setup, recoverable signaling interruptions also emit reconnecting. Keep waiting
for connect() before dialing; concurrent calls to connect() share the same pending connection.
The original connectTimeoutMs deadline still applies (15 seconds by default), and authentication
failures reject immediately. Timeout stops the underlying connection.
Calling disconnect() during setup rejects the pending promise with connection_canceled, returns
the state to idle, and prevents a later timeout error. This cancellation does not emit a call-failure
event. Close unused server-side tickets separately; see WebRTC security.
Relay — RevDeskRoom
active means the destination answered. Stop local ringback on that state.
Audio playback permission is separate: subscribe to audioPlaybackChanged before join() and
show an “Enable call audio” button when it reports false. Call call.startAudio() directly
from the button’s click/tap handler, catching rejection if playback remains blocked. A playback
block does not end the call. Read call.canPlaybackAudio for the current permission state.
Calls fail through the
error event with a typed RevDeskCallError (code is one of connection_failed,
connection_timeout, call_rejected, …).