@zencomms/provider-telnyx
v0.1.0-alpha.2
Published
ZenComms provider-telnyx package
Readme
@zencomms/provider-telnyx
Telnyx adapter for ZenComms: voice (Call Control), SMS, MMS, conference, and
webhook signature verification. Implements the voice and messaging ports from
@zencomms/core and @zencomms/cc-types.
Install
pnpm add @zencomms/provider-telnyxStability
Alpha — APIs may change until 0.1.0.
Entry points
@zencomms/provider-telnyx— single root export at./dist/index.js. ExposesTelnyxVoiceAdapter,TelnyxCallControlClient,TelnyxSmsAdapter,TelnyxConferenceAdapter,verifyTelnyxWebhookSignature, and the Telnyx request/response schemas.@zencomms/provider-telnyx/browser— browser-only WebRTC voice adapter. Uses a short-lived Telnyxlogin_tokenminted by the ZenComms backend.
Usage
Server Call Control:
import { TelnyxVoiceAdapter } from '@zencomms/provider-telnyx';
const voice = new TelnyxVoiceAdapter();
await voice.connect({
apiKey: process.env.TELNYX_API_KEY!,
connectionId: process.env.TELNYX_CONNECTION_ID!,
telnyxPublicKey: process.env.TELNYX_PUBLIC_KEY!,
});Browser WebRTC:
import { createTelnyxBrowserVoicePort } from '@zencomms/provider-telnyx/browser';
const voice = createTelnyxBrowserVoicePort({
callerNumber: '+15551234567',
});
await voice.connect();By default the browser adapter calls POST /api/v1/voice/login-token with
credentials: "include" and passes the returned loginToken into
new TelnyxRTC({ login_token }). External apps can proxy that backend route
or pass fetchLoginToken in the adapter config.
See also
- See the root README for architecture and contributing.
- ADR-001 explains contract stability.
