Node.js Express Middleware Email Verification Guide
Add real-time email verification and disposable-email blocking to Node.js Express Middleware with the VeriShield Edge API. The snippet below gates a signup and returns the canonical email identity.
Language
JavaScript / TypeScript
Ecosystem
NPM
Latency
< 85ms
Install
Shell
npm install expressVerification code
JavaScript / TypeScript
export const verishieldGuard = async (req, res, next) => {
const response = await fetch('https://verishield-edge-api.p.rapidapi.com/v1/verify', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-RapidAPI-Key': process.env.RAPIDAPI_KEY },
body: JSON.stringify({ email: req.body.email })
});
const data = await response.json();
if (data.fraud_risk.recommendation === 'BLOCK') return res.status(403).json({ error: 'Blocked' });
req.canonicalEmail = data.canonical_email;
next();
};What this protects against
Disposable and temporary inboxes, Gmail dot-trick and plus-alias multi-accounting, high-entropy bot usernames, and freshly registered fraud domains. The API returns a 0-100 fraud score with an ALLOW, CHALLENGE_2FA or BLOCK recommendation.