@emailverifier/sdk
v0.1.31
Published
Email verifier SDK with free offline checks, the emailverifier.dev API client, and a CLI.
Maintainers
Readme
Email Verifier SDK
Offline email analysis, a typed client for emailverifier.dev, and a CLI in one package.
The offline functions use bundled data and make no network requests. They can identify syntax problems, disposable providers, free mailbox providers, role addresses, and common provider typos. They cannot confirm whether a mailbox exists or will accept mail.
Install
npm install @emailverifier/sdkNode.js 20 or newer is required. The package has no runtime dependencies and sends no telemetry.
Free offline analysis
import { analyzeEmail } from '@emailverifier/sdk/offline'
const result = analyzeEmail('[email protected]')
console.log(result.checks.syntax)
console.log(result.checks.disposable)
console.log(result.checks.freeProvider)
console.log(result.checks.roleBased)
console.log(result.suggestion)The result intentionally has no deliverable field. DNS, SMTP recipient acceptance, and catch-all detection require the hosted API.
You can also import focused helpers:
import {
isDisposableDomain,
isFreeEmailProvider,
isRoleAddress
} from '@emailverifier/sdk/offline'Hosted verification
Create a project at emailverifier.dev, then use its API key:
import { EmailVerifier } from '@emailverifier/sdk'
const client = new EmailVerifier({
apiKey: process.env.EMAILVERIFIER_API_KEY!
})
const verification = await client.verify('[email protected]')
const domain = await client.checkDomain('example.com')
const usage = await client.getUsage()verify and checkDomain each use one project credit. getUsage does not use a credit. The client does not retry failed requests automatically.
CLI
Run local analysis without an account or API key:
npx @emailverifier/sdk check [email protected]
npx @emailverifier/sdk check [email protected] --jsonRemote commands read the key from the environment. API keys are deliberately not accepted as command-line arguments because command histories and process lists can expose them.
export EMAILVERIFIER_API_KEY=ev_your_project_key
npx @emailverifier/sdk verify [email protected]
npx @emailverifier/sdk domain example.com
npx @emailverifier/sdk usageUse EMAILVERIFIER_BASE_URL only when testing against a local or self-selected API origin.
Data updates
The disposable-domain snapshot comes from disposable/disposable-email-domains and includes additional maintained aliases. Its license is recorded in THIRD_PARTY_NOTICES.md.
The scheduled GitHub workflow validates upstream data, commits changed snapshots, and publishes a tested patch release. Configure npm Trusted Publishing for GitHub owner usamaejaz, repository emailverifier, workflow update-data.yml, environment npm, and the npm publish action.
License
MIT
