AI Prompt

Copy-paste these prompts into your AI coding tool to add disposable email blocking to your app instantly.

Works with Claude Code, Cursor, GitHub Copilot, Windsurf, Cline, and any AI coding assistant.

How to use

Copy the prompt below, paste it into your AI coding tool, and let it implement the changes across your codebase. The AI will find your signup flows and add the check automatically.

Universal Prompt

Works with any framework or setup. The AI will figure out where to add the check.

Copy this into your AI coding toolmarkdown
Add disposable email validation to my app using the @isdisposable/js package.

## What to do:
1. Install the package: npm install @isdisposable/js
2. Find where users sign up or submit their email (signup forms, registration, invite flows, waitlist, etc.)
3. Before creating the user or processing the email, add a check
4. If the email is disposable, reject it with a clear error message like "Please use a permanent email address"

## Option A — Offline check (simple, instant):
- import { isDisposable } from '@isdisposable/js'
- isDisposable('test@mailinator.com') returns true (disposable)
- isDisposable('user@gmail.com') returns false (legitimate)
- It's synchronous, returns a boolean, zero dependencies, works offline
- 160,000+ known disposable domains bundled in the package
- For bulk checking: import { isDisposableBulk } from '@isdisposable/js'

## Option B — API check (real-time, catches new domains):
- import { createIsDisposable } from '@isdisposable/js'
- const client = createIsDisposable({ apiKey: 'isd_your_key' })
- const { disposable, score, reason } = await client.check(email)
- Returns a score (0-100), reason, and disposable boolean
- Built-in caching, configurable timeout, automatic offline fallback
- For bulk: await client.checkBulk(['email1@test.com', 'email2@test.com'])
- Get an API key at https://isdisposable.com/dashboard/api-keys

## Rules:
- Check BEFORE creating the user in the database, not after
- Show a user-friendly error, not a generic 400
- Don't log the full email for privacy — only log the domain if needed
- The offline check is instant (<1ms), the API check takes 1-5 seconds
- Make sure to check on the server side, not client side (client checks can be bypassed)

Next.js

For Next.js apps with server actions or API routes.

Next.js promptmarkdown
Add disposable email blocking to my Next.js app using @isdisposable/js.

Install: npm install @isdisposable/js

Add this check in my signup server action or API route:

import { isDisposable } from '@isdisposable/js';

if (isDisposable(email)) {
  return { error: 'Please use a permanent email address. Disposable emails are not allowed.' };
}

Find all places where users submit emails (signup, invite, waitlist, contact forms) and add this check before processing. The function is synchronous and returns a boolean. It works on the server side, edge runtime, and middleware.

Express / Node.js

For Express, Fastify, Hono, or any Node.js server.

Express promptmarkdown
Add disposable email blocking to my Express app using @isdisposable/js.

Install: npm install @isdisposable/js

Add this middleware or inline check on any route that accepts emails:

import { isDisposable } from '@isdisposable/js';

// In your signup/registration route:
if (isDisposable(req.body.email)) {
  return res.status(400).json({ error: 'Please use a permanent email address.' });
}

Find all routes where users submit emails and add this check before creating the user. The function is synchronous, returns a boolean, and has zero dependencies.

Better Auth

For apps using Better Auth for authentication.

Better Auth promptmarkdown
Add disposable email blocking to my Better Auth setup using @isdisposable/js.

Install: npm install @isdisposable/js

Add this to my auth config using databaseHooks:

import { isDisposable } from '@isdisposable/js';

export const auth = betterAuth({
  // ... existing config
  databaseHooks: {
    user: {
      create: {
        before: async (user) => {
          if (isDisposable(user.email)) {
            throw new APIError('BAD_REQUEST', {
              message: 'Please use a permanent email address. Disposable emails are not allowed.',
            });
          }
          return user;
        },
      },
    },
  },
});

Import APIError from 'better-auth/api'. This blocks disposable emails before the user is created in the database.

Supabase Auth

For apps using Supabase Auth for signups.

Supabase Auth promptmarkdown
Add disposable email blocking to my Supabase app using @isdisposable/js.

Install: npm install @isdisposable/js

Before calling supabase.auth.signUp(), check the email:

import { isDisposable } from '@isdisposable/js';

// In your signup handler (server-side):
if (isDisposable(email)) {
  return { error: 'Please use a permanent email address.' };
}

// Only proceed with signup if email is clean:
const { data, error } = await supabase.auth.signUp({ email, password });

Add this check on the server side (API route or server action), not on the client.

API Client (Real-time)

For catching brand-new disposable services that aren't in the offline blocklist yet. Uses the same npm package with an API key.

API client promptmarkdown
Add real-time disposable email detection to my app using the @isdisposable/js API client.

Install: npm install @isdisposable/js

Create a client instance (do this once, e.g., in a lib/email.ts file):

import { createIsDisposable } from '@isdisposable/js';

export const emailChecker = createIsDisposable({
  apiKey: process.env.ISDISPOSABLE_API_KEY!,
  // timeout: 5000,  // optional, default 5s
  // cache: true,     // optional, default true
  // cacheTTL: 3600,  // optional, default 1 hour
});

Use it in signup/registration handlers:

const { disposable, score, reason } = await emailChecker.check(email);
if (disposable) {
  return { error: 'Please use a permanent email address.' };
}

The client automatically:
- Calls the isDisposable API for real-time DNS/MX analysis
- Caches results to avoid repeat API calls
- Falls back to offline blocklist if the API is unreachable
- Supports bulk checking: await emailChecker.checkBulk(emails)

Get an API key at https://isdisposable.com/dashboard/api-keys

Add to CLAUDE.md

If you use Claude Code, add this rule to your project's CLAUDE.md file so Claude always validates emails in your project:

CLAUDE.mdmarkdown
## Email Validation

Always validate emails against disposable/temporary email providers before creating users or processing signups.

Use the @isdisposable/js package:
- import { isDisposable } from '@isdisposable/js'
- isDisposable(email) returns true if the email is disposable
- Check on the server side, before database writes
- Show a clear error: "Please use a permanent email address"

Works with any AI tool

These prompts are designed to work with any AI coding assistant. The AI reads the prompt, understands your codebase, and adds the disposable email check in the right places automatically.