@mailsentry/node
v1.0.1
Published
Official Node.js SDK for the MailSentry email validation API
Maintainers
Readme
@mailsentry/node
Official Node.js SDK for the MailSentry email validation API.
Installation
npm install @mailsentry/nodeQuick Start
import MailSentry from "@mailsentry/node";
const client = new MailSentry({ apiKey: "ms_live_your_key_here" });
// Single verification
const result = await client.verify("[email protected]");
console.log(result.score, result.verdict);
// Bulk verification
const bulk = await client.bulkVerify([
"[email protected]",
"[email protected]",
"[email protected]",
]);
console.log(`Validated ${bulk.total} emails`);
// Get job details
const job = await client.getBulkJob(bulk.id);
// List recent jobs
const jobs = await client.listBulkJobs();Configuration
const client = new MailSentry({
apiKey: "ms_live_your_key_here", // Required
baseUrl: "https://mailsentry.dev", // Optional (default)
timeout: 30000, // Optional: request timeout in ms (default: 30s)
});API Reference
verify(email: string): Promise<ValidationResult>
Validates a single email address. Returns score (0-100), verdict, and detailed checks across 8 validation layers.
bulkVerify(emails: string[], filename?: string): Promise<BulkJobResponse>
Validates multiple emails in one request. Batch size depends on your plan.
getBulkJob(jobId: string): Promise<BulkJobDetail>
Retrieves the full results of a bulk validation job.
listBulkJobs(): Promise<BulkJobListItem[]>
Lists your 20 most recent bulk validation jobs.
Error Handling
import { MailSentryError } from "@mailsentry/node";
try {
const result = await client.verify("[email protected]");
} catch (err) {
if (err instanceof MailSentryError) {
console.error(`API error ${err.status}: ${err.message}`);
}
}Links
- Documentation
- Sign up — 1,000 free checks/month
