Sign Up Free

Node.js Email Verification SDK — JavaScript Email Validator

Everything you need to integrate email verification into your application.

Getting Started

The official Node.js SDK provides a type-safe interface for email verification. Written in TypeScript with full type definitions, it supports CommonJS and ESM with zero production dependencies.

Install via npm and verify emails in three lines. The SDK handles authentication, rate limiting, retries, and errors automatically. Works with Node.js 14+, Express, Fastify, and Next.js. For web verification, visit our email verifier.

Code Example

npm install @ev-ecomtechbd/node

import { EmailVerifier } from '@ev-ecomtechbd/node';

const verifier = new EmailVerifier('YOUR_API_KEY');
const result = await verifier.verify('user@example.com');

console.log(result.status);     // "deliverable"
console.log(result.score);      // 95
console.log(result.disposable); // false

// Batch verification
const results = await verifier.verifyBatch([
  'alice@example.com',
  'bob@example.com'
]);
results.forEach(r => console.log(r.email, r.status));

Authentication & Setup

Install: npm install @ev-ecomtechbd/node. Initialize EmailVerifier with your API key. The SDK reads EV_API_KEY from environment variables if no key is passed. Supports TypeScript out of the box.

Getting Started

To install the Node.js email verification SDK, run npm install @ev-ecomtechbd/node in your project directory. The package supports both CommonJS (require) and ES Modules (import) out of the box, with full TypeScript type definitions included. The SDK requires Node.js 14 or higher and has zero production dependencies, keeping your bundle size minimal. If you are using Yarn, run yarn add @ev-ecomtechbd/node instead. For pnpm users, pnpm add @ev-ecomtechbd/node works identically.

After installation, create an instance of EmailVerifier by passing your API key directly or by setting the EV_API_KEY environment variable. For production deployments, we strongly recommend using environment variables to avoid committing secrets to version control. The SDK constructor accepts an optional configuration object where you can set timeout (default 30000ms), retries (default 3), sandbox mode for testing, and a custom baseUrl if you are using a dedicated endpoint. The client is designed to be instantiated once and reused across your application, as it manages connection pooling and retry logic internally.

Code Examples

Single Email Verification

import { EmailVerifier } from '@ev-ecomtechbd/node';

const verifier = new EmailVerifier(process.env.EV_API_KEY);

async function verifySingleEmail(email) {
  const result = await verifier.verify(email);

  console.log(result.email);       // "user@example.com"
  console.log(result.status);      // "deliverable"
  console.log(result.score);       // 95
  console.log(result.disposable);  // false
  console.log(result.roleAccount); // false
  console.log(result.mxFound);     // true

  return result;
}

Batch Email Verification

import { EmailVerifier } from '@ev-ecomtechbd/node';

const verifier = new EmailVerifier(process.env.EV_API_KEY);

async function verifyEmailList(emails) {
  // Submit batch job (up to 50,000 emails per batch)
  const job = await verifier.verifyBatch(emails);
  console.log('Job ID:', job.id);
  console.log('Status:', job.status); // "processing"

  // Wait for completion with built-in polling
  const results = await verifier.waitForBatch(job.id, {
    pollInterval: 5000,  // check every 5 seconds
    timeout: 600000      // max wait 10 minutes
  });

  // Process results
  const deliverable = results.filter(r => r.status === 'deliverable');
  const invalid = results.filter(r => r.status === 'undeliverable');
  console.log(`Valid: ${deliverable.length}, Invalid: ${invalid.length}`);
  return results;
}

verifyEmailList(['alice@example.com', 'bob@company.org', 'test@temp.io']);

Check Previous Verification Result

import { EmailVerifier } from '@ev-ecomtechbd/node';

const verifier = new EmailVerifier(process.env.EV_API_KEY);

// Retrieve a cached verification result without using credits
async function getCachedResult(email) {
  const result = await verifier.getResult(email);
  if (result) {
    console.log(`Last verified: ${result.verifiedAt}`);
    console.log(`Status: ${result.status}, Score: ${result.score}`);
  } else {
    console.log('No previous verification found, running new check...');
    return await verifier.verify(email);
  }
  return result;
}

Error Handling

The Node.js SDK throws typed exceptions that you can catch with standard try/catch blocks in async code. The base class EvError is extended by specific error types: AuthenticationError for invalid or expired API keys, RateLimitError when you exceed your plan's request quota, ValidationError for malformed email addresses, and NetworkError for connectivity issues. Each error object includes a statusCode, message, and code property for programmatic handling.

For rate limiting, the SDK automatically retries requests with exponential backoff when it receives a 429 response. You can customize this behavior by setting maxRetries and retryDelay in the constructor options. The RateLimitError includes a retryAfter property indicating the number of seconds to wait. For batch operations, partial failures are collected in the errors array of the batch result rather than throwing exceptions, so your job continues processing valid emails even when some fail. Monitor the verifier.rateLimitRemaining property to proactively throttle your requests before hitting the limit.

import { EmailVerifier, RateLimitError, AuthenticationError } from '@ev-ecomtechbd/node';

const verifier = new EmailVerifier(process.env.EV_API_KEY, {
  maxRetries: 3,
  retryDelay: 1000
});

try {
  const result = await verifier.verify('user@example.com');
} catch (error) {
  if (error instanceof RateLimitError) {
    console.log(`Rate limited. Retry after ${error.retryAfter} seconds.`);
  } else if (error instanceof AuthenticationError) {
    console.error('Invalid API key. Check your EV_API_KEY variable.');
  } else {
    console.error('Verification failed:', error.message);
  }
}

Frequently Asked Questions

The SDK supports Node.js 14 and above. It is written in TypeScript and includes type definitions for full IDE autocompletion. Both CommonJS (require) and ESM (import) module formats are supported. The SDK has zero production dependencies.

Yes, all SDK methods return Promises and work with async/await. The SDK also supports callback-style usage for legacy codebases. Batch verification returns an async iterator for processing large result sets without memory issues.

Yes, the SDK is written in TypeScript and ships with full type definitions. All response objects, error types, and configuration options are fully typed. Install with npm install @ev-ecomtechbd/node and import types directly.

Start Verifying Emails Today

100 daily free verifications. No credit card required. Full API access on all plans. Visit our email verifier to get started.

Try our free email verifier — verify any email instantly, no signup required. Need bulk verification? Upload your list and clean thousands of emails in minutes.

Developers: integrate email verification into your app with our RESTful API — SDKs for 7 languages.

Free tools: SPF checker · DKIM checker · SMTP tester