@cold-email-agent/sdk
v1.0.0
Published
Typed SDK for the Cold Outreach Agent API — supports Bearer token and x402 wallet payments
Maintainers
Readme
@cold-outreach/sdk
Typed TypeScript SDK for the Cold Outreach Agent API. Supports Bearer token auth and x402 wallet payments (no signup required).
Install
npm install @cold-outreach/sdkFor x402 wallet payments, also install viem:
npm install @cold-outreach/sdk viemQuick Start (x402 — no signup)
import { ColdOutreachClient } from '@cold-outreach/sdk';
import { getContext, createClient, discoverClient } from '@cold-outreach/sdk/clients';
import { discoverProspects } from '@cold-outreach/sdk/prospects';
import { createCampaign, generateEmails, startCampaign } from '@cold-outreach/sdk/campaigns';
const client = new ColdOutreachClient({
mode: 'x402',
baseUrl: 'https://your-instance.example.com',
privateKey: '0x...', // Funded USDC wallet
});
const ctx = await getContext(client);
const biz = await createClient(client, { name: 'Acme Corp', website: 'https://acme.com' });
client.setClientId(biz.id);
await discoverClient(client, { websiteUrl: 'https://acme.com' });
const leads = await discoverProspects(client, {
locations: [{ city: 'Helsinki', state: '', country: 'Finland' }],
industries: ['SaaS'],
limit: 50,
});Quick Start (Bearer Token)
import { login } from '@cold-outreach/sdk/auth';
import { ColdOutreachClient } from '@cold-outreach/sdk';
import { getContext } from '@cold-outreach/sdk/clients';
const { token } = await login({
baseUrl: 'https://your-instance.example.com',
email: '[email protected]',
password: 'your-password',
});
const client = new ColdOutreachClient({
mode: 'bearer',
baseUrl: 'https://your-instance.example.com',
token,
});
const ctx = await getContext(client);Modules
| Import | Description |
|--------|-------------|
| @cold-outreach/sdk | ColdOutreachClient, SDKError, namespace re-exports |
| @cold-outreach/sdk/auth | login() |
| @cold-outreach/sdk/clients | Client, ICP, email settings management |
| @cold-outreach/sdk/prospects | Discovery, enrichment, deep research |
| @cold-outreach/sdk/campaigns | Campaign CRUD, email generation, execution |
| @cold-outreach/sdk/inbox | Inbox read, reply, draft management |
| @cold-outreach/sdk/analytics | Overview, campaign analytics |
| @cold-outreach/sdk/credits | Balance and history |
x402 Protocol
When using mode: 'x402', the SDK transparently handles HTTP 402 Payment Required responses:
- Your request hits a paid endpoint
- Server responds with 402 + pricing in USDC
- SDK signs a payment with your wallet key
- SDK retries the request with a
PAYMENT-SIGNATUREheader - Server verifies payment, settles on-chain, returns the data
No signup, no API key, no credit purchase. Your wallet address becomes your identity.
Pricing (USDC on Base)
| Action | Price | |--------|-------| | Read endpoints | $0.001 | | Client discovery + ICP | $0.50 | | Lead discovery | $0.10/lead | | Deep research | $0.25/phase | | Email generation | $0.05/email | | Campaign execution | $0.01/email |
License
MIT
