verifex
v0.2.0
Published
Official Node.js SDK for Verifex — Real-time Sanctions Screening API
Maintainers
Readme
Verifex Node.js SDK
Official Node.js/TypeScript SDK for Verifex — Real-time Sanctions Screening API.
Screen persons and entities against OFAC, UN, EU, UK, Canada, Australia, Switzerland sanctions lists and 700K+ PEP records in a single API call.
Installation
npm install verifexQuick Start
import { Verifex } from "verifex";
const verifex = new Verifex({ apiKey: "vfx_your_api_key" });
// Screen a person
const result = await verifex.screen({ name: "Vladimir Putin" });
if (result.isMatch) {
console.log(`Risk: ${result.riskLevel}`); // "critical"
for (const match of result.matches) {
console.log(`${match.name} (${match.source}) — ${match.confidence}%`);
}
} else {
console.log("Clear — no sanctions match");
}API Reference
new Verifex(config)
const verifex = new Verifex({
apiKey: "vfx_your_api_key", // Required
baseUrl: "https://api.verifex.dev", // Optional
timeout: 30000, // Optional (ms)
});verifex.screen(options)
Screen a single person or entity.
const result = await verifex.screen({
name: "Hezbollah", // Required
type: "entity", // Optional: "person" | "entity"
country: "Lebanon", // Optional
dateOfBirth: "1952", // Optional
mode: "broad", // Optional: "exact" | "broad" (default: "broad")
});
console.log(result.riskLevel); // "critical"
console.log(result.totalMatches); // 15
console.log(result.isClear); // false
console.log(result.isMatch); // true
console.log(result.matches[0].name); // "HIZBALLAH"
console.log(result.matches[0].confidence); // 100
console.log(result.matches[0].source); // "OFAC"
console.log(result.matches[0].matchType); // "EXACT"verifex.batchScreen(entities)
Screen multiple entities in one request (Pro plan+).
const batch = await verifex.batchScreen([
{ name: "Vladimir Putin", type: "person" },
{ name: "Sberbank", type: "entity" },
{ name: "John Doe" },
]);
for (const result of batch.results) {
console.log(`${result.query.name}: ${result.riskLevel} (${result.totalMatches} matches)`);
}
console.log(`Total time: ${batch.totalDurationMs}ms`);verifex.usage()
Get current usage statistics.
const usage = await verifex.usage();
console.log(`Plan: ${usage.plan}`);
console.log(`Used: ${usage.currentMonthUsage} / ${usage.monthlyQuota}`);
console.log(`Remaining: ${usage.remaining}`);verifex.health()
Check API status (no authentication required).
const health = await verifex.health();
console.log(`Status: ${health.status}`); // "ok"
console.log(`Entries: ${health.totalEntries}`); // 745648
console.log(`Healthy: ${health.isHealthy}`); // trueverifex.listKeys() / verifex.createKey() / verifex.revokeKey()
Manage API keys programmatically.
// List keys
const keys = await verifex.listKeys();
// Create a new key
const newKey = await verifex.createKey("Production");
console.log(newKey.key); // "vfx_..." (shown only once!)
// Revoke a key
await verifex.revokeKey(keys[0].id);Error Handling
import { Verifex, VerifexError, RateLimitError, QuotaExceededError } from "verifex";
try {
const result = await verifex.screen({ name: "Test" });
} catch (err) {
if (err instanceof RateLimitError) {
console.log(`Rate limited. Retry in ${err.retryAfter}s`);
} else if (err instanceof QuotaExceededError) {
console.log("Monthly quota exceeded. Upgrade your plan.");
} else if (err instanceof VerifexError) {
console.log(`API error: ${err.message} (${err.code})`);
}
}TypeScript
Full TypeScript support with exported types:
import type { ScreenResult, Match, RiskLevel, ScreenOptions } from "verifex";CommonJS
const { Verifex } = require("verifex");
const verifex = new Verifex({ apiKey: "vfx_your_key" });Links
License
MIT
