Frameworks and SDKs

Svelte integration

A FormGuard.svelte component, or the use:formGuard action on any element, checks the email fields of your Svelte and SvelteKit forms as the visitor leaves them. It offers a fix for typos, holds back addresses that cannot receive mail and throwaway inboxes, and lets the form through whenever a check cannot be made.

Read the full setup guideGet an API key

  • Setup guide
  • A component, or the use:formGuard action

FormGuard.svelteSvelte 5

Svelte
<FormGuard browserKey="YOUR_BROWSER_KEY">
  <form action="/signup" method="post">
    <input type="email" name="email" />
  </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
Svelte and SvelteKit developers who collect sign-ups, leads or support requests and want a mistyped or dead address flagged next to the field, not discovered later in a bounce.
You need
Svelte 5 with SvelteKit or without (the action alone also works in Svelte 4), 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.

  • Component or action

    Wrap a form in FormGuard on Svelte 5, or put the use:formGuard action on the element yourself, which also works in Svelte 4. Both guard the same way.

  • Ask for a fixable address

    A likely typo gets the corrected address as a button, taken with a click, a tap, Enter or Space. A domain that is already a known provider is never corrected.

  • A message that fits your page

    The message uses your page’s colour, so it reads in light and dark themes. Your own CSS always wins, or set the form guard’s custom properties.

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 files

    There is no npm package yet: download the form guard files from the guide and copy core.ts, svelte.ts and FormGuard.svelte from the zip’s src/ folder into one folder of your app.

  2. 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. Make it for this site only: your site’s addresses (and the one you test on) as allowed origins, and a daily credit cap.

  3. Guard your form

    Put <FormGuard browserKey="…"> around the form, or use:formGuard on it. Leave log-in and password forms alone with data-ev-guard="off".

  4. Check it works

    Try no_mailbox@sandbox.email-validation.org (message, form stopped), likely_typo@sandbox.email-validation.org (a fix offered) and accepted@sandbox.email-validation.org (goes through). Test addresses are free. On a form that mails the address, try only the ones that stop it.

Good to know.

  • By default invalid and disposable results stop the form and catch_all goes through; valid results, also those with a warning, and unknown results always go through.

  • No answer in time, a network error, a refused key, no credits left or a rate limit: the field passes and the form submits. After a refused key or with no credits left, it stops checking on that page.

  • Your key is public once it is in the page. With only Validate addresses it cannot read your usage or start bulk lists, but each answer shows your remaining credits. Set a daily credit cap: it is what limits the cost.

  • Set pinned to load this version’s frozen file with Subresource Integrity, whose bytes never change.

  • The message is announced by screen readers and linked to the field, and on a stopped submit the field gets the focus.

Connect Svelte.

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