Configuration
ThePatter constructor accepts LocalOptions.
Local Mode
LocalOptions
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
mode | "local" | Yes | — | Must be "local" to enable local mode. |
phoneNumber | string | Yes | — | Your phone number in E.164 format. |
webhookUrl | string | Yes | — | Public hostname for webhooks (no protocol prefix, no path). |
twilioSid | string | Conditional | — | Twilio Account SID. Required if not using Telnyx. |
twilioToken | string | Conditional | — | Twilio Auth Token. Required when twilioSid is set. |
openaiKey | string | No | — | OpenAI API key for the realtime adapter. |
telephonyProvider | "twilio" | "telnyx" | No | "twilio" | Which telephony provider to use. |
telnyxKey | string | Conditional | — | Telnyx API key. Required if telephonyProvider is "telnyx". |
telnyxConnectionId | string | No | — | Telnyx SIP Connection ID for outbound calls. |
telnyxPublicKey | string | No | — | Telnyx Ed25519 public key (base64 DER/SPKI) for webhook signature verification. |
Webhook URL Format
ThewebhookUrl must be a bare hostname with no protocol prefix or path:
https://{webhookUrl}/webhooks/twilio/voice).
Using Telnyx
Telnyx delivers 16kHz PCM audio natively, so no transcoding is needed. Twilio uses mulaw 8kHz, which the SDK transcodes automatically.
Environment Variables
We recommend loading credentials from environment variables. Never hardcode secrets:--env-file flag (Node 20.6+):

