@mentionsapi/sdk (Node)
Fully typed Node SDK with class-based clients for every endpoint, automatic rate-limit + 5xx retry, and webhook HMAC verification. Drop-in for any Node 18+ project (TypeScript or JavaScript).
Install
bash
npm install @mentionsapi/sdk
# or pnpm / yarn
pnpm add @mentionsapi/sdk
yarn add @mentionsapi/sdkQuickstart
javascript
import { MentionsAPI } from "@mentionsapi/sdk";
const client = new MentionsAPI({ apiKey: process.env.MENTIONSAPI_KEY! });
const result = await client.check({
mode: "all_live",
query: "best CRM for small business",
brand: "HubSpot",
});
console.log(result.providers.perplexity.citations);Watch CRUD
javascript
await client.watch.create({
query: "best CRM for small business",
brand: "HubSpot",
mode: "all_live",
interval: "daily",
webhook_url: "https://your-app.com/webhooks/mentions",
webhook_secret: process.env.MENTIONS_WEBHOOK_SECRET!,
trigger_on: ["mention_added", "mention_removed", "rank_changed", "citation_changed"],
});Notes
- The SDK retries 429 + 5xx with exponential backoff (capped at 4 attempts).
- Pass
idempotencyKeyas a per-call option to enable Stripe-style replay. - For raw fetch calls, see the curl reference.