The following Node.js server-side helper makes one verification request. It returns review on a timeout or unexpected outcome rather than silently rejecting the user. It does not automatically repeat paid work. Connect it to your own framework, authentication rules, and logging policy.
async function checkSignupEmail(email) {
try {
const response = await fetch("https://api.validatedmails.com/validate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.VALIDATEDMAILS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ email }),
signal: AbortSignal.timeout(120000),
});
if (!response.ok) return "review";
const result = await response.json();
if (result.status === "invalid") return "correct_address";
if (result.status === "valid") return "continue";
return "review"; // risky, unknown, or unexpected response
} catch {
return "review"; // no automatic paid retry
}
}