@clawpro/node
v0.2.0
Published
Official Node.js / TypeScript SDK for the ClawPro Instagram outbound API.
Maintainers
Readme
@clawpro/node
Official Node.js / TypeScript SDK for the ClawPro Instagram outbound API — connect sending accounts, run competitor-audience campaigns, score leads, manage webhooks, and read usage.
npm install @clawpro/nodeRequires Node 18+ (uses the global fetch). Get an API key from the developer portal → API & Developers → API Keys.
Quick start
import { ClawPro } from '@clawpro/node';
const clawpro = new ClawPro({ apiKey: process.env.CLAWPRO_API_KEY! });
// Connect a sending account (geo-matched mobile proxy assigned automatically)
const account = await clawpro.accounts.create({ username: 'burner_account', country: 'gb' });
// Launch a campaign against your competitors' engagers
const campaign = await clawpro.campaigns.create({
accountId: account.id,
name: 'Founders engaging with X',
targets: ['@influencer1', '@influencer2'],
offer: 'We help B2B founders book demos via Instagram outbound.',
icpCriteria: 'B2B SaaS founders or growth leads, 1–50 employees, US/UK.',
dailyDmTarget: 20,
});
await clawpro.campaigns.run(campaign.id);
// Read warm replies, then mark a lead booked (fires the `lead.booked` webhook)
const inbox = await clawpro.campaigns.inbox(campaign.id);
if (inbox[0]) await clawpro.leads.update(inbox[0].id, { status: 'booked' });Authentication
Every request sends your key as the X-API-Key header. Keys carry a scope:
full, read (GET only), or write (mutations only). The API is rate-limited
per key (see the X-RateLimit-* response headers).
Resources
| Resource | Methods |
|---|---|
| accounts | list(), create(), delete(id) |
| campaigns | list(), create(), update(id, patch), run(id), leads(id, {status?}), inbox(id) |
| leads | update(id, { status }) |
| webhooks | events(), list(), create(), delete(id), test(id), deliveries(id) |
| keys | list(), create(), revoke(id) |
| usage | summary(), logs(filter) |
Errors
Non-2xx responses throw a typed ClawProError:
import { ClawPro, ClawProError } from '@clawpro/node';
try {
await clawpro.accounts.create({ username: 'taken_handle' });
} catch (err) {
if (err instanceof ClawProError) {
console.error(err.status, err.message, err.requestId); // e.g. 409 "@taken_handle is already connected"
}
}Configuration
new ClawPro({
apiKey: '...',
baseUrl: 'https://api.tryclawpro.com', // override for self-hosted / staging
timeoutMs: 30_000,
fetch: customFetch, // optional fetch override
});License
MIT
