SDKs
JavaScript / Node.js
Check emails with the IronDome Node.js client. Reuse its HTTPS pool, classify API errors, and submit bulk checks.
On this page
Check a signup address from your Node.js server before creating an account. Keep the API key in server configuration and reuse one client across requests.
Availability
Install the published JavaScript SDK:
npm install @irondome-dev/sdk@0.2.0
Use Node.js 22 or newer.
Create and reuse a client
Set IRONDOME_API_KEY in your server environment. The SDK defaults to https://api.irondome.dev.
// server.mjs
import { IronDome, APIError } from '@irondome-dev/sdk/node';
const client = new IronDome({
apiKey: process.env.IRONDOME_API_KEY,
timeoutMs: 5000,
});
export async function checkEmail(email) {
try {
return await client.check(email);
} catch (error) {
if (error instanceof APIError) {
console.error({ status: error.status, code: error.code, requestId: error.requestId });
}
throw error;
}
}
// Call this from the server's shutdown hook, after requests have drained.
export function closeIronDome() {
client.close();
}
For a one-shot script, close its client after the check completes:
// check-once.mjs
import { checkEmail, closeIronDome } from './server.mjs';
try {
console.log(await checkEmail('person@example.com'));
} finally {
closeIronDome();
}
Call checkEmail from your existing signup flow. For a complete server-side handler and failure policy, follow the Node.js signup validation tutorial. Do not expose an unrestricted public endpoint that forwards arbitrary checks. The client owns a keep-alive HTTPS pool; closing it after each request discards that pool and can interrupt concurrent calls.
Run the Express example
Download the runnable Node.js signup example, extract it, and open a terminal in the node-signup folder. Use Node.js 22 or newer:
npm ci --ignore-scripts
npm test
npm start
This pins Express 5.3.0 and @irondome-dev/sdk 0.2.0. By default it uses offline fixtures, needs no API key, and listens only on 127.0.0.1:3000. No accounts are created and no email is sent.
In a second terminal, try an allowed and a blocked signup:
curl -i http://127.0.0.1:3000/signup -H 'Content-Type: application/json' --data '{"email":"allowed@example.test"}'
curl -i http://127.0.0.1:3000/signup -H 'Content-Type: application/json' --data '{"email":"blocked@example.test"}'
The allowed fixture returns application HTTP 202 with status: "demo_signup_continued". The blocked fixture returns application HTTP 422 without invoking signup. These reserved .test addresses select offline responses, not real provider classifications. Use curl.exe in Windows PowerShell.
The example preserves the Node.js tutorial's deliberate fail-open policy: timeout@example.test also continues the mocked signup with 202, without claiming the address is non-disposable. Choose your own outage policy before production; the signup validation guide describes a fail-closed alternative.
The included README explains optional live screening and the auth integration boundary. Live mode submits the address to IronDome and can count toward your allowance, but still does not create an account. Replace the mock inside your real account-creation flow, retain syntax validation, rate limits and ownership verification, and protect every alternate signup path. Do not deploy the local demo as a production auth server.
Results and failures
check() returns provider, valid, disposable, and reason, with optional requestId and detectorVersion. A disposable result can guide your signup policy. valid does not prove that a mailbox exists or can receive mail.
An invalid address is an APIError with status 422 and code invalid_email. Configuration, local validation, busy-client, timeout, protocol, and transport failures are also errors. Do not convert a failure to disposable: false; a timed-out request may already have been processed.
Warmup and bulk checks
client.warmup() optionally sends an unauthenticated health request through the same pool. Start it ahead of independent work if useful; avoid adding a health round trip before every check.
const batch = await client.checkBulk(['person@example.com', 'invalid']);
for (const item of batch.results) {
if ('error' in item) console.log(item.index, item.error.code);
else console.log(item.index, item.disposable);
}
Bulk results preserve input order. Each syntactically valid address counts as a check. See the bulk API guide and performance guide.