Sign-up and auth
Auth.js integration
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 guideGet an API key
- Setup guide
- One TypeScript file with no dependencies
EV_API_KEY your API keyAt 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 made for it, with a daily credit cap, kept in a server variable.
- Costs
- 1 credit = 1 validated address, as with any API request. Free: unknown results, API errors, malformed addresses and test addresses on sandbox.email-validation.org.
- Full guide
- Read the full setup guide
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, which stays the reference when a step does not match what you see.
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/.
Add it to auth.ts
Create the check with
createSignInCheck({ apiKey: process.env.EV_API_KEY, adapter })and pass it ascallbacks.signIn. An existing signIn callback calls it first.Check your registration code
For email and password sign-ups, call
checkSignupEmail()before your code creates the user, and refuse whenallowis false.Test it
On the server,
checkSignupEmail('disposable@sandbox.email-validation.org', { apiKey })answersallow: 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.
Connect Auth.js.
Test it on our sandbox addresses for free, then on your own contacts.
Updated · Maintained by: Email Validation LLC