# Auth.js Integration: Email Validation

URL: https://email-validation.org/integrations/authjs/
Updated: 2026-11-29

> Documentation index: https://email-validation.org/llms.txt

A file you add to your Auth.js configuration checks each new user’s address with our API in the signIn callback and, when the result is one you stop, Auth.js refuses the sign-up. With your adapter or an isNewUser function, returning users are not checked; without them, checkEverySignIn: true checks every sign-in. Your own registration code can run the same check for email and password sign-ups.

[Read the full setup guide](https://email-validation.org/docs/guides/authjs/) [Get an API key](https://email-validation.org/signin/)

- Status: Setup guide
- One TypeScript file with no dependencies

**Server variable** never in browser code

Environment

```text
EV_API_KEY   your API key
```

## At a glance.

- **Status**: **Setup guide.** Not listed on a marketplace yet: you set it up yourself in a few steps, below and in the full guide.
- **For**: Apps that sign users in with Auth.js (NextAuth.js v5) and want accounts made with an undeliverable or throwaway address kept out, from social sign-ins, magic links and passkeys alike.
- **You need**: An app on Auth.js, ideally with a database adapter so new users can be told from returning ones, and an [API key](https://email-validation.org/app/api-keys/) made for it, with a [daily credit cap](https://email-validation.org/docs/authentication/#limits), kept in a server variable.
- **Costs**: 1 credit = 1 validated address, as with any API request. Free: unknown results, API errors, malformed addresses, test addresses on sandbox.email-validation.org and, in a bulk list, repeats of an address (charged once).
- **Full guide**: [Read the full setup guide](https://email-validation.org/docs/guides/authjs/)

## Typical uses.

- **Stop it before the account exists**: A new user with a stopped address gets Auth.js’s “Access denied” page, and no user or account is created. A magic link to a stopped address is never sent.
- **Never lock out a returning user**: The file asks your adapter whether the person already has an account and checks only new users. Without an adapter, you choose: your own isNewUser function, or a check on every sign-in.
- **Check your own sign-up form**: Auth.js leaves email and password sign-ups to your code. Call checkSignupEmail() there before you create the user, and offer the suggested correction for a typo.

## Set it up. 4 steps.

The short version of the [full setup guide](https://email-validation.org/docs/guides/authjs/), which stays the reference when a step does not match what you see.

1. **Download the file**: It is not on a registry yet: download email-validation-authjs.ts from the guide and copy it into your app, for example to lib/.
2. **Add it to auth.ts**: Create the check with `createSignInCheck({ apiKey: process.env.EV_API_KEY, adapter })` and pass it as `callbacks.signIn`. An existing signIn callback calls it first.
3. **Check your registration code**: For email and password sign-ups, call `checkSignupEmail()` before your code creates the user, and refuse when `allow` is false.
4. **Test it**: On the server, `checkSignupEmail('disposable@sandbox.email-validation.org', { apiKey })` answers `allow: false`, for free. Ask for a magic link only for a test address the check stops: test addresses receive no mail.

## Good to know.

- For provider sign-ins, only the signIn callback can refuse a sign-in in Auth.js (Credentials sign-ins can also be refused in authorize), so a person signing in with a provider has already signed in there; the check runs before Auth.js creates the user.
- No key, a timeout, no credits or any other error lets the sign-up through, and so does a failing database lookup. The file never throws into Auth.js.
- Anyone can start a sign-in with any address, and each new address checked uses a credit: give the key a daily credit cap and rate-limit your sign-in route.
- The file never logs an address and sends it only to our US host, or with `region: 'eu'` to our [EU host](https://email-validation.org/docs/eu-data-residency/).

## Related

- [The full Auth.js setup guide](https://email-validation.org/docs/guides/authjs/)
- [What it stops, per sign-in method](https://email-validation.org/docs/guides/authjs/#how-it-works)
- [Choose what to stop](https://email-validation.org/docs/guides/authjs/#options)
- [Test addresses](https://email-validation.org/docs/test-addresses/)
- [Better Auth integration](https://email-validation.org/integrations/better-auth/)
- [Clerk integration](https://email-validation.org/integrations/clerk/)
- [Amazon Cognito integration](https://email-validation.org/integrations/cognito/)
- [Firebase integration](https://email-validation.org/integrations/firebase/)
- [All integrations](https://email-validation.org/integrations/)
