Sign-up and auth

Firebase integration

A blocking function in your Firebase project checks the email address of each new user before Firebase Authentication creates the account, and refuses the addresses you chose to stop: by default ones that cannot receive mail and throwaway inboxes. If our API is slow, unreachable or answers with an error, the sign-up goes through.

Read the full setup guideGet an API key

  • Setup guide
  • One file you copy into functions/

email-validation.cjs2nd or 1st gen functions

Terminal
# store the key as a secret
firebase functions:secrets:set EV_API_KEY

# optional, in functions/.env
#   EV_REGION=eu
#   EV_STOP_STATUSES=invalid,disposable

firebase deploy --only functions

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
Firebase apps whose users sign up with an email address, by password, by email link or through Google and other providers, and that want undeliverable or throwaway addresses refused before the user record exists.
You need
Firebase Authentication with Identity Platform (blocking functions belong to it), Cloud Functions on the Blaze plan with firebase-functions 6 or later, and an API key made for it, with a daily credit cap.
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.

  • Refuse addresses that bounce

    An invalid result fails the sign-up call in your app with a message saying the address cannot receive email, and adds Did you mean …? when the API has a correction.

  • Turn away disposable inboxes

    Throwaway addresses are refused by default and asked for a permanent one. You can also stop catch_all or unknown results, at the cost of turning away some real people.

  • Fit it into your own function

    Firebase holds one before-create function per project. If you have one already, call checkSignupEmail from it and refuse the sign-up when the check says stop.

Set it up. 5 steps.

The short version of the full setup guide, which stays the reference when a step does not match what you see.

Read the full setup guide

  1. Download the file

    It is not on a marketplace: download email-validation.cjs from the guide and copy it into your project’s functions/ folder, beside its package.json.

  2. Store your key as a secret

    Create an API key with Validate addresses and a daily credit cap, run firebase functions:secrets:set EV_API_KEY and paste the key when asked.

  3. Export the function

    In functions/index.js, export beforeUserCreated() from the file, or beforeCreate() on 1st gen. The guide has the lines for TypeScript and ES module projects.

  4. Deploy

    Run firebase deploy --only functions. The function then shows under Authentication, Settings, Blocking functions.

  5. Try it

    Sign up in your app with no_mailbox@sandbox.email-validation.org: it is refused, at no cost. Never sign up with a test address that goes through, such as accepted@sandbox.email-validation.org: your app’s verification email would bounce.

Good to know.

  • Anonymous and custom-token sign-ins are not checked, because Firebase runs no blocking function for them, and a sign-up by phone number has no address to check.

  • Firebase allows a blocking function only a few seconds, and the check waits less than that and never retries. A late answer, a wrong key, no credits or any error in the check lets the sign-up through (if the function itself fails to answer in Firebase’s time, after a crash or a slow cold start, Firebase refuses the sign-up), with the reason in the function’s logs, never the address.

  • Set EV_STOP_STATUSES to none to refuse nobody and only log each result, so you can see what it would do before it turns anyone away.

  • Firebase wraps the refusal in its own error text, so most apps show their own sentence when the error’s message contains Cloud Function.

  • Only the email address leaves your project, to our US host or, with EV_REGION set to eu, our EU host: no name, IP address or user id.

Connect Firebase.

Test it on our sandbox addresses for free, then on your own contacts.

Create your accountRead the full setup guide

Updated · Maintained by: Email Validation LLC