VerifyAI Node.js SDK
Add AI-powered photo verification to your Node.js backend. Full TypeScript support, Express middleware, and built-in webhook handling for production-ready integrations.
Quick Start
1. Install
npm install @switchlabs/verifyai-node2. Use
import { VerifyAI } from '@switchlabs/verifyai-node';
const client = new VerifyAI({ apiKey: 'vi_live_...' });
const result = await client.verify({
imagePath: './photo.jpg',
policy: 'scooter_parking',
});
if (result.isCompliant) {
console.log('Verified:', result.verificationId);
} else {
console.log('Issue:', result.feedback);
result.violations.forEach(v => {
console.log(` - ${v.type}: ${v.description}`);
});
}Features
TypeScript Native
Written in TypeScript with full type definitions. Autocomplete and compile-time checking for all methods and responses.
Express Middleware
Drop-in Express middleware for handling file uploads and verification in a single route handler.
Webhook Handler
Built-in webhook signature verification and payload parsing. Works with Express, Fastify, and raw Node.js HTTP.
Streaming Results
Stream batch verification results as they complete using async iterators. Process results in real time.
File & Buffer Support
Accept images from file paths, Buffers, Streams, or URLs. Automatic content-type detection and optimization.
Automatic Retries
Configurable retry logic with exponential backoff. Handles rate limits and transient errors gracefully.
Code Examples
Requirements
- Node.js 18 or higher
- VerifyAI API key (free sandbox available)
- TypeScript 5.0+ (optional but recommended)
- Express 4.x or 5.x (for middleware features)
Frequently Asked Questions
Start Building with Node.js
Install the SDK and add photo verification to your backend in minutes.