npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

call2me-sdk

v1.3.0

Published

Call2Me Node.js SDK — Build AI voice agents

Downloads

388

Readme

Call2Me Node.js SDK

The official Node.js SDK for Call2Me — the AI voice agent platform.

Build, deploy, and manage AI voice agents that handle real phone calls, extract data, and take automated actions.

npm License

Features

  • 15 API Resources — Full coverage of the Call2Me REST API
  • Voice Agents — Create agents with 30+ AI models and custom voices
  • Phone & Web Calls — Inbound/outbound via SIP, browser, or chat widget
  • Campaigns — Bulk outbound calling with CSV upload
  • Scheduled Calls — Book follow-ups at specific dates
  • Post-Call Intelligence — Auto-extract data and trigger actions
  • Knowledge Base — RAG-powered answers from your documents
  • White-Label — Custom branding, domain, and tenant management
  • Payments — Checkout, saved cards, auto-charge
  • Zero Dependencies — Uses native fetch

Installation

npm install call2me-sdk

Requires Node.js 18+

Getting Your API Key

  1. Sign up at dashboard.call2me.app — you get $10 free credits
  2. Go to API Keys in the dashboard
  3. Click Create API Key and copy your sk_call2me_... key

Quick Start

const { Call2Me } = require('call2me-sdk');
const client = new Call2Me('sk_call2me_...');

// Create an agent
const agent = await client.agents.create({
  agent_name: 'Sales Agent',
  voice_id: 'elevenlabs-selin',
  language: 'tr-TR',
  response_engine: {
    type: 'call2me-llm',
    system_prompt: 'You are a friendly sales agent.'
  }
});

// List calls
const calls = await client.calls.list();

// Check balance
const balance = await client.wallet.balance();
console.log(`Balance: $${balance.balance_usd}`);

Full API Reference

Agents

await client.agents.list(limit, offset)
await client.agents.get('agent_id')
await client.agents.create({ agent_name, voice_id, ... })
await client.agents.update('agent_id', { agent_name: 'New Name' })
await client.agents.delete('agent_id')
await client.agents.duplicate('agent_id')
await client.agents.stats('agent_id', days)
await client.agents.globalStats()

Calls

await client.calls.list(limit, offset, agentId)
await client.calls.get('call_id')
await client.calls.end('call_id')
await client.calls.recording('call_id')

Knowledge Base

await client.knowledgeBases.list()
await client.knowledgeBases.get('kb_id')
await client.knowledgeBases.create({ name: 'FAQ', description: '...' })
await client.knowledgeBases.delete('kb_id')
await client.knowledgeBases.addSource('kb_id', { type: 'text', content: '...' })
await client.knowledgeBases.query('kb_id', 'question', topK)

Campaigns

await client.campaigns.list()
await client.campaigns.get('campaign_id')
await client.campaigns.create({ name, agent_id, from_number })
await client.campaigns.update('campaign_id', { name: 'Updated' })
await client.campaigns.delete('campaign_id')
await client.campaigns.start('campaign_id')
await client.campaigns.pause('campaign_id')
await client.campaigns.resume('campaign_id')
await client.campaigns.cancel('campaign_id')
await client.campaigns.contacts('campaign_id')

Scheduled Calls

await client.schedules.list()
await client.schedules.get('schedule_id')
await client.schedules.create({ agent_id, phone_number, scheduled_at, timezone })
await client.schedules.update('schedule_id', { scheduled_at: '...' })
await client.schedules.delete('schedule_id')
await client.schedules.cancel('schedule_id')

Phone Numbers

await client.phoneNumbers.list()
await client.phoneNumbers.get('+908501234567')
await client.phoneNumbers.create({ phone_number, trunk_id })
await client.phoneNumbers.update('+908501234567', { display_name: 'Main' })
await client.phoneNumbers.delete('+908501234567')
await client.phoneNumbers.bindAgent('+908501234567', 'agent_id')
await client.phoneNumbers.unbindAgent('+908501234567')

SIP Trunks

await client.sipTrunks.list()
await client.sipTrunks.get('trunk_id')
await client.sipTrunks.create({ name, sip_server, sip_username, sip_password })
await client.sipTrunks.update('trunk_id', { name: 'Updated' })
await client.sipTrunks.delete('trunk_id')
await client.sipTrunks.test('trunk_id')

Wallet & Billing

await client.wallet.balance()
await client.wallet.transactions(limit, offset)
await client.wallet.analytics(days)
await client.wallet.pricing()

Payments

await client.payments.checkout(50.0, 'USD')
await client.payments.history(limit)
await client.payments.savedCards()
await client.payments.autoCharge()
await client.payments.updateAutoCharge({ enabled: true, threshold: 5, charge_amount: 50 })

API Keys

await client.apiKeys.list()
await client.apiKeys.create({ name: 'Production Key' })
await client.apiKeys.revoke('key_id')
await client.apiKeys.delete('key_id')
await client.apiKeys.usage('key_id')

Users & Branding

await client.users.me()
await client.users.update({ full_name: 'John Doe' })
await client.users.stats()
await client.users.usage(days)
await client.users.dailyUsage(days)
await client.users.branding()
await client.users.updateBranding({ app_name: 'My Platform', primary_color: '#6366f1' })
await client.users.tenantMembers(page, perPage)

Widgets

await client.widgets.list()
await client.widgets.get('widget_id')
await client.widgets.create({ agent_id, name: 'Support' })
await client.widgets.update('widget_id', { welcome_message: 'Hi!' })
await client.widgets.delete('widget_id')
await client.widgets.chat('widget_id', 'Hello, I need help')

Voices

await client.voices.list()
await client.voices.providers()

Chats

await client.chats.list(limit)
await client.chats.get('session_id')
await client.chats.sendMessage('session_id', 'Hello!', model)

Events

Forward application errors and business events to the Call2Me observability pipeline. The POST endpoint is public; sending the API key lifts your per-minute ceiling from 10 (anon) to 100.

await client.events.report('payment_failed', 'Paddle rejected the webhook', {
  source: 'api',
  severity: 'error',
  meta: { payment_id: 'pay_abc', provider: 'paddle' },
});

// Admin-only — query archived (error+) events:
await client.events.query({ severity: 'error', hours: 24 });

Common type values: js_error, unhandled_rejection, http_5xx, auth_login, auth_signup, payment_success, payment_failed, call_started, call_ended, call_failed, agent_crash.

Error Handling

try {
  const agent = await client.agents.get('invalid_id');
} catch (err) {
  console.error(err.message); // "Call2Me API Error 404: Agent not found"
}

Links

Changelog

1.3.0 (2026-04-24)

  • Add events resource — client.events.report() and .query() for forwarding errors and business events to the observability pipeline.
  • First real src/index.d.ts for TypeScript autocomplete.
  • Published with npm provenance via OIDC Trusted Publishing (no NPM_TOKEN).

1.2.0

  • All 14 resources, campaigns, schedules, widgets.

License

MIT