Sign-up and auth

Stytch integration

Your server checks a new address with our API before it calls Stytch and, when the result is one you stop, Stytch is never called and no user or member is created. An optional webhook handler reports the sign-ups your server never sees (it also sees users your server checked: skip those or they are checked twice).

Read the full setup guideGet an API key

  • Setup guide
  • One TypeScript file with no dependencies

Server variablesnever in browser code

Environment
EV_API_KEY              your API key
STYTCH_WEBHOOK_SECRET   your Stytch webhook signing secret (webhook notice only)

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 on Stytch, Consumer or B2B, whose server sends sign-ups to Stytch and that want undeliverable or throwaway addresses refused before a user or member exists.
You need
A server that calls Stytch’s backend API for sign-ups, and an API key made for it, with a daily credit cap, kept in a server variable. Your Stytch project secret stays where it is.
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 before Stytch is called

    Wrap each Stytch call that can create a user or member, such as a magic link or OTP sign-up, a password or an invite. A stopped address never reaches Stytch.

  • Let log-ins through free

    Stytch’s log-in-or-sign-up calls serve log-ins too. Tell the guard which addresses already have an account, and log-ins go through unchecked and cost nothing.

  • Hear about the rest

    OAuth (Consumer and B2B), SSO, SCIM and browser-only sign-ups are not stopped: the guard does not cover them, not even B2B OAuth discovery, whose address is known before an organization is created or joined. The optional webhook handler checks those new users and tells your code; it changes nothing in Stytch.

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.

Read the full setup guide

  1. Download the file

    It is not on a registry yet: download email-validation-stytch.ts from the guide and copy it into your server code, for example to lib/.

  2. Create a guard

    Call createStytchSignupGuard() with your key and an isExistingUser function that knows your accounts.

  3. Wrap your Stytch calls

    Run each create call through signupGuard.protect(email, () => …) and answer a SignupRefusedError with its message.

  4. Test it

    Sign up through your form with disposable@sandbox.email-validation.org: it is refused before Stytch is called, for free.

Good to know.

  • Stytch has no hook that runs before it creates a user, so sign-ups that skip your server, such as OAuth or Stytch’s browser-side login components, can only be reported afterwards.

  • No key, a timeout, no credits or any other error lets the sign-up through. A check is never retried.

  • The webhook handler refuses any delivery whose signature it cannot verify, and answers every verified one so Stytch does not resend it.

  • The file never logs an address and sends it only to our US host, or with region: 'eu' to our EU host.

Connect Stytch.

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