<!-- Markdown representation of https://www.getpatter.com/products/typescript-sdk -->
> Give your TypeScript AI agent a phone number with 4 lines of code. Express-based, fully typed, production-ready. Open source.

Canonical URL: https://www.getpatter.com/products/typescript-sdk
Site map: https://www.getpatter.com/sitemap.xml · Overview for LLMs: https://www.getpatter.com/llms.txt · Developer resources: https://www.getpatter.com/developers

---
Open Source MIT Licensed

# TypeScript SDK

Give your Node.js AI agent a phone number. Express-based embedded server, full type safety, same API surface as the Python SDK.

`npm install getpatter`

index.ts 4 lines

```typescript
import { Patter, Twilio, OpenAIRealtime } from "getpatter";

const phone = new Patter({ carrier: new Twilio(), phoneNumber: "+15550001234" });
const agent = phone.agent({ engine: new OpenAIRealtime(), systemPrompt: "You are a friendly receptionist." });
await phone.serve({ agent, tunnel: true });
```

Quick Start

## 4 lines to a phone call

- Connect your telephony provider and start handling phone calls

- Full TypeScript types for messages, events, and config

- Express-based embedded server — no Patter backend needed

- Works with any LLM — OpenAI, Anthropic, or your own

- Built-in webhook validation for Twilio and Telnyx (Beta)

[Getting started guide →](https://docs.getpatter.com)

Features

## Everything you need to connect your agent to phone calls

### Type-Safe Config

Every option is typed. `LocalConfig`, `AgentConfig`, `IncomingMessage` — autocomplete everywhere.

### Instance-based voice stack

End-to-end with `new OpenAIRealtime()` / `new ElevenLabsConvAI()`, or pipeline mode with `new DeepgramSTT()` + `new AnthropicLLM()` + `new ElevenLabsTTS()` — swap any piece.

### Webhook Security

Built-in Twilio signature verification and Telnyx (Beta) Ed25519 validation. No Patter backend required.

### System Tools

Auto-injected `transfer_call` and `end_call` tools. Define custom tools with webhook URLs.

### Event Lifecycle

`onCallStart`, `onCallEnd`, `onTranscript` — hook into every stage of the call.

### Recording

One flag to enable call recording. Recordings managed by your telephony provider.

### Output Guardrails

Block terms, run custom validators, or replace responses before they reach TTS.

### DTMF & Variables

Keypad input as transcript events. Dynamic `{variable}` substitution in system prompts.

## Start building in minutes

Install the SDK, write a handler, connect a phone number.

[Read the docs →](https://docs.getpatter.com/typescript-sdk/overview)
