TypeScript SDK

Install

$npm install phonic

Initialize the client

1import { PhonicClient } from "phonic";
2
3const client = new PhonicClient({
4 apiKey: process.env.PHONIC_API_KEY,
5});

Create an agent

1await client.agents.create({
2 name: "my-first-agent",
3 phone_number: "assign-automatically",
4});

Make an outbound call

1await client.conversations.outboundCall({
2 to_phone_number: "YOUR_PHONE_NUMBER", // e.g. +19189391262
3 config: {
4 agent: "my-first-agent",
5 welcome_message: "Hello, how can I help you?",
6 }
7});
See Via Webhooks for the full walkthrough, including inbound calls, or the API reference for the complete SDK surface.