TypeScript SDK

Install

npm install phonic

Initialize the client

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

Create an agent

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

Make an outbound call

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