Node.js SDK
The official Devotel Node.js SDK provides a fully typed client for the Devotel API. Built with TypeScript, it supports all Devotel services — messaging, voice, agents, flows, numbers, and verify.Installation
Quick Start
Messaging
Voice
The Voice resource exposes call control, recordings, transcripts, conferences, IVR, dialer campaigns, SIP trunks, and analytics. See Voice operations below for the full surface.AI-agent / IVR routing and webhooks are not per-call options. Configure them once on the Application / IVR Flow that owns the number — the call then follows that routing. See Voice operations below.
Voice operations
A complete tour of the live call-control surface. Every snippet matches the actual SDK API inpackages/sdk-node/src/resources/voice.ts.
Make a call
Routing, AI agents, IVR, and webhooks are configured at the Application / IVR-Flow level, not percreate()call.voice.calls.create()only acceptsto,from,record,amd,campaignId,orgTimezone, andmetadata; any other field is silently stripped by the server. Attach the destination number to an Application (or IVR Flow) and the call inherits its agent/IVR routing and webhook configuration.
Get call details
Hang up a call
Transfer a call
Both cold (blind) and warm (consult-first) transfers are supported on the sametransfer() method:
warmTransfer() forwards its params to the server verbatim, so the field
names below are camelCase exactly as shown — the route validates them
under those keys:
destination— E.164 number to consult-then-bridge to (required).from— optional caller ID presented on the consultation leg.contextWhisper— whentrue, a short summary is spoken to the receiving agent on answer, before the bridge. Defaults tofalse.context— optional custom whisper text (max 220 characters). When omitted whilecontextWhisperistrue, a generic summary is spoken.
Conference call
Conference participant controls
Once a conference is live, the moderator can mute, hold, kick, lock, and record fromorbit.voice.conferences.*. The participantId is the
Jambonz call_sid of the leg (the leg_call_sid field on each row of the
conference detail / listParticipants response):
IVR flows
Trigger a published IVR flow as an outbound session, or browse the flow catalog:Conversational IVR intents
Per-tenant NLU buckets the LLM classifier uses to route free-speech caller utterances to an ACD queue or a direct agent:Outbound dialer campaigns
Manage power/predictive dialer campaigns. Status changes flow through the server’s campaign state machine —start() and pause() are ergonomic
wrappers over the status transition:
SIP trunks
Voice clones & VAQI analytics
Record a call
Recording is started by passingrecord: true at call creation; pause/resume happens via call-control endpoints. After the call ends, fetch the recording metadata and a signed download URL:
Listen to a recording
Live transcript stream (Node-only)
Voice webhook handling
Verify the signature with the shared SDK helper, then dispatch onevent.type:
The signing secret is the dashboard-issued whsec_... value from your endpoint’s
settings (see Webhook Security) — a customer-side secret you
store in your own environment, not an Orbit env.ts variable. Name the env var
whatever you like; ORBIT_WEBHOOK_SECRET is used here.
Verify
Webhooks
Error Handling
Every non-2xx response is thrown as anOrbitApiError, but the SDK constructs a
status-specific subclass so you can branch on the failure mode. Narrow on the
subclass first, then fall back to the OrbitApiError base. All of these names are
importable from @devotel/orbit-sdk:
OrbitApiError (base), OrbitAuthError (401/403), OrbitNotFoundError (404),
OrbitRateLimitError (429), OrbitValidationError (400/422), OrbitServerError
(5xx), and OrbitWebhookSignatureError (webhook verification — extends Error,
not OrbitApiError).
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | Your Devotel API key (required) |
baseUrl | string | https://api.orbit.devotel.io/api/v1 | API base URL |
Requirements
- Node.js 18 or later
- TypeScript 5.0+ (recommended but not required)