TypeScript SDK
Use @babelforce/babelconnect-sdk to build your own browser interface around live agent state.
Your first softphone is the complete setup and working example.
Install
npm install @babelforce/babelconnect-sdk
The package is ESM-only, targets ES2022, and is side-effect-free for tree shaking. It runs in modern
browsers and Node 20+ for control-only use. CommonJS callers use a dynamic import:
const { BabelconnectClient } = await import("@babelforce/babelconnect-sdk").
Browser audio needs microphone permission and a secure context (HTTPS or localhost).
The SDK speaks gRPC-web directly to the server; no separate protocol proxy is required.
Token exchange uses the same origin's /oauth/token, but the
PKCE consent page may use another origin.
If your app has a different origin, add it to the server's CORS allowlist. An empty list allows
all origins and is intended for development only.
Which entry point?
| Goal | Entry point | Guide |
|---|---|---|
| Custom UI with browser audio | package root | Tutorial · Client lifecycle |
| State, SMS or external-phone control | package root, mediaFactory: null | Control only |
| Ready-made agent UI | @babelforce/babelconnect-sdk/embed | Embedding |
API surface at a glance
| Area | Reference |
|---|---|
| Connection and options | BabelconnectClient · ConnectOptions |
| State and intents | State & events · Intents |
| Login, PKCE, revocation | Authentication |
| Custom WebRTC | Media · MediaFactory |
| Every export | TypeScript API |
Porting a Go client? Read TypeScript vs Go before relying on defaults.