Frameworks and SDKs
React integration
A FormGuard component wraps the forms of your React app and checks each email field once the visitor has finished with it, with a one-click fix for typos. It stops the form only for the results you choose, invalid and disposable by default, and every submission goes through when something goes wrong.
Read the full setup guideGet an API key
- Setup guide
- Two files you copy into your app
import { FormGuard } from './form-guard/react';
<FormGuard browserKey="YOUR_BROWSER_KEY">
<form action="/signup" method="post">
<input type="email" name="email" />
<button>Sign up</button>
</form>
</FormGuard>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
- Developers of React apps, Next.js and Remix included, who want a mistyped or dead address caught in the sign-up or contact form while the visitor can still fix it.
- You need
- React 18 or 19, and a browser key made just for the site: only the Validate addresses permission, your site’s addresses as allowed origins, and 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.
Fix typos with one click
A domain a letter or two away from a big mailbox provider gets a suggestion with the fixed address as a button. The fix is worked out in the browser and costs nothing.
Stop only what you choose
invalid and disposable results stop the form by default, with a short message next to the field. Set stop to add catch_all, or to stop nothing and keep only the typo fixes.
Forms sent from a click handler
The component stops only real form submissions. If your app sends the form from a click handler, await check(field) there and go on unless stop is true.
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 files
There is no npm package yet: download the form guard files from the guide and copy core.ts and react.ts from the zip’s src/ folder into one folder of your app.
Create a browser key
Under API keys, click Create API key and pick “On a public web page” (browser key) under “Where will you use this key?”: such a key can only validate addresses. Add your site’s addresses and the address you test on as allowed origins, and a daily credit cap.
Wrap your form
Import
FormGuardand put it around your form with your key inbrowserKey. Putdata-ev-guard="off"on your log-in and password forms.Test it
no_mailbox@sandbox.email-validation.orgshows the message and stops the form,likely_typo@sandbox.email-validation.orgalso offers a fix, andaccepted@sandbox.email-validation.orggoes through, at no cost. On a form that mails the address, try only the ones that stop it.
Good to know.
Nothing runs during server rendering. Strict mode and route changes load the script once, and a form that unmounts is no longer guarded.
The browser key sits in your page’s source, so treat it as public. Allowed origins stop other websites from using it in their visitors’ browsers; the daily credit cap is what limits the cost.
No answer in time, a refused key, no credits left or any error: the field passes and the form submits. valid and unknown results always go through.
The script is one per page, so give every FormGuard on a page the same settings. Once loaded, it guards every email field on the page, also outside the component, until the visitor leaves.
A page that enforces Trusted Types adds
ev-form-guardto itstrusted-typesdirective; the Content Security Policy entries are in the form guard docs.
Connect React.
Test it on our sandbox addresses for free, then on your own contacts.
Updated · Maintained by: Email Validation LLC