IPAbuse Developers
Beginner10 min

Using the Node.js SDK

The official @ipabuse/sdk package provides a type-safe client for Node.js and TypeScript. It handles authentication, retries, and error normalisation so you can focus on your application logic.

1

Install the package

Add the SDK to your project using npm, yarn, or pnpm.

cURL
npm install @ipabuse/sdk
2

Initialise the client

Create a single client instance and reuse it across your app.

client.ts
import { IPAbuseClient } from "@ipabuse/sdk";

const client = new IPAbuseClient({
  apiKey: process.env.IPABUSE_API_KEY!,
});
3

Look up an IP

All methods return fully-typed responses.

lookup.ts
const result = await client.ip.get("1.2.3.4");

console.log(result.reputationScore);  // number
console.log(result.riskLevel);        // "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
console.log(result.categories);       // string[]