Official SDK Documentation

JavaScript SDK

Install the official NexMailPro JavaScript SDK from npm and verify email addresses from modern browser and Node.js workflows with full TypeScript support.

Published package details

npm package

@nexmailpro/sdk

Client class

NexMailProClient

Module formats

ESM + CommonJS

Runtime support

Browser + Node.js

Primary method

verifyEmail()

TypeScript typings

Bundled

JS

NexMailPro JavaScript SDK

npm-first integration for browser and server-side workflows

Wraps the live POST /api/v1/verify/email endpoint.
Ships typed success responses plus dedicated API and transport error classes.
Works well for signup flows, CRM imports, browser extensions, internal tools, and Node.js services.

1. Installation

Install the official package from npm. The published package name is @nexmailpro/sdk.

npm install @nexmailpro/sdk

2. Node.js Example

Use the SDK from a modern Node.js service, script, queue worker, or internal application.

import { NexMailProClient } from "@nexmailpro/sdk";

const client = new NexMailProClient({
  apiKey: process.env.NEXMAILPRO_API_KEY ?? "YOUR_API_KEY",
});

const result = await client.verifyEmail("[email protected]");

console.log(result.data.status);
console.log(result.meta?.credits_charged);

3. Browser Example

Browser integrations should run in trusted environments such as internal tools, browser extensions, or apps that proxy requests through your backend so long-lived API keys are not exposed publicly.

import { NexMailProClient } from "@nexmailpro/sdk";

const client = new NexMailProClient({
  apiKey: window.NEXMAILPRO_API_KEY ?? "YOUR_API_KEY",
});

const result = await client.verifyEmail("[email protected]");

console.log(result.data);

4. CommonJS Example

The published package also exposes a CommonJS entry point for require()-based projects.

const { NexMailProClient } = require("@nexmailpro/sdk");

const client = new NexMailProClient({
  apiKey: process.env.NEXMAILPRO_API_KEY || "YOUR_API_KEY",
});

client.verifyEmail("[email protected]").then((result) => {
  console.log(result.data);
});

5. Example Response

Successful SDK calls return the same JSON structure documented for the live NexMailPro API.

{
  "success": true,
  "message": "Verification completed",
  "data": {
    "email": "[email protected]",
    "status": "valid",
    "sub_status": "deliverable",
    "score": 90,
    "is_syntax_valid": true,
    "has_mx": true,
    "domain_exists": true
  },
  "meta": {
    "credits_charged": 1
  }
}

6. Features

✓ TypeScript First

The official package ships bundled TypeScript typings for application code, SDK consumers, and editor autocomplete.

✓ Browser + Node.js

Use the same SDK in frontend tooling, backend services, internal dashboards, and Node.js workflows.

✓ ESM + CommonJS

The published package includes import and require entry points so modern and legacy JS projects can both integrate cleanly.

✓ Typed Errors

Catch API and transport failures with dedicated error classes and inspect status codes, response payloads, and error codes.

✓ Bulk Helpers Included

Wrap single verification plus the documented bulk upload, status, start, and results endpoints from one client package.

✓ Zero Runtime Dependencies

The SDK stays lightweight by relying on the Fetch API and bundling the build output directly.

7. Requirements

Node.js 18+

Node.js 18 or newer is recommended for native Fetch support without extra polyfills.

Modern Browser

Use a browser with the Fetch API available or provide your own compatible fetch implementation.

API Key

Create a NexMailPro API key from your dashboard and store it securely in your server runtime or trusted client environment.

Outbound HTTPS

Your runtime must be able to send HTTPS requests to NexMailPro API endpoints.

9. FAQ

How do I install the NexMailPro JavaScript SDK?

Install the official package from npm by running npm install @nexmailpro/sdk in your JavaScript or TypeScript project.

Which class should I import?

Import NexMailProClient from @nexmailpro/sdk. The package also exports NexMailPro as a compatible alias.

Does the SDK support browsers and Node.js?

Yes. The published package supports modern browsers and Node.js runtimes with bundled TypeScript typings and both ESM and CommonJS builds.

Can I call the verification endpoint from frontend code?

Yes, but production browser integrations should use trusted environments or a backend proxy so long-lived API keys are not exposed publicly.

Need help

Pair the SDK docs with the live API reference

Review the REST API documentation for authentication, bulk verification endpoints, error codes, and response envelopes, or contact NexMailPro if your team needs help planning the integration.