For your AI coding tool
Integrate DisposableGuard
If you use Claude Code, Cursor, Codex, Copilot, or Aider, point your tool at the LLM-targeted integration guide and let it write the code for you. Otherwise, follow the six steps below.
prompt: Read https://disposableguard.xyz/integrate.md and follow the instructions on that page.
01
Get your API key
Sign up at /sign-up, then open /dashboard/keys and click Create Key. Copy the key (it looks like dg_live_...).
02
Store it as an environment variable
Add to your .env.local:
DG_KEY=dg_live_...Never commit the key. Never paste it in client-side code.
03
Add a helper function
async function isDisposableEmail(email) {
try {
const res = await fetch(
"https://www.disposableguard.xyz/api/v1/check?email=" +
encodeURIComponent(email),
{ headers: { Authorization: "Bearer " + process.env.DG_KEY } }
);
if (!res.ok) return false;
const data = await res.json();
return data.is_disposable === true;
} catch {
return false;
}
}Returns true if disposable, false otherwise. Returns false on any error.
04
Call it from your signup handler
const { email } = parsedRequest;
if (await isDisposableEmail(email)) {
return Response.json(
{ error: "Please use a real email address." },
{ status: 400 }
);
}05
Fail open on errors
The helper above already fails open (returns false on any error so signup proceeds). This is intentional: blocking real users because DisposableGuard is down is worse than letting one disposable signup through.
06
Test it
Verify the integration by signing up with:
test@mailinator.com→ should be rejectedyou@gmail.com→ should succeed
For batch signup (CSV imports, list cleaning)
POST https://www.disposableguard.xyz/api/v1/check/batch
Authorization: Bearer <DG_KEY>
Content-Type: application/json
{ "emails": ["a@b.com", "c@d.com"] }Up to 100 emails per batch call.