Quick Setup
Add the script tag and call Verifox.init() before </head> on every page that has email inputs. The widget auto-attaches to all [type="email"] inputs on page load, and watches for dynamically added inputs via MutationObserver. No data-* attributes required — just include the script.
Verifox.init() Options
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey | string | Optional · undefined | Your FoxGuard widget API key. Without a key, falls back to the public tier (4 verifications/day per device). Get yours at verifox.ai/dashboard/foxguard. |
selector | string | Optional · "[type=\"email\"]" | CSS selector targeting the email inputs to protect. Supports any valid CSS selector — multiple with commas. |
blockDisposable | boolean | Optional · true | Reject throwaway / temporary email services (Mailinator, Guerrilla Mail, 10MinuteMail, and 10,000+ others). |
blockFree | boolean | Optional · false | Reject free consumer email providers: Gmail, Yahoo, Outlook, Hotmail, iCloud, etc. Use for B2B sign-up forms that require work emails. |
redHighlight | boolean | Optional · true | Apply a red border and light red background to the input field when validation fails. Matches the field's existing border-radius. |
showTooltip | boolean | Optional · true | Render a tooltip message directly below the email input on validation failure (or success if messages.valid is set). |
lang | "en" | "it" | "es" | "fr" | "de" | Optional · "en" | Language for the built-in default messages. Ignored if you provide custom messages.* values. |
messages.disposable | string | Optional · "Disposable emails are not allowed" | Custom tooltip copy shown when a disposable email is detected and blockDisposable is true. |
messages.free | string | Optional · "Please use a work email address" | Custom tooltip copy shown when a free provider is detected and blockFree is true. |
messages.valid | string | Optional · undefined | Optional success message shown below the input when the email passes all checks. Leave empty to show nothing on success. |
messages.warning | string | Optional · undefined | Shown for catch-all or risky emails that pass but may have deliverability issues. |
onValid | (e: { email: string; result: object }) => void | Optional · undefined | Callback fired when an email passes all validation checks. Use to unlock form submit or show custom UI. |
onInvalid | (e: { email: string; reason: string; result: object }) => void | Optional · undefined | Callback fired when an email is blocked. reason is one of: 'disposable' | 'free' | 'invalid'. Use to disable form submit. |
onWarning | (e: { email: string; result: object }) => void | Optional · undefined | Callback fired for risky emails that are not outright blocked (catch-all, role accounts). |
apiKeystringoptYour FoxGuard widget API key. Without a key, falls back to the public tier (4 verifications/day per device). Get yours at verifox.ai/dashboard/foxguard.
selectorstringoptCSS selector targeting the email inputs to protect. Supports any valid CSS selector — multiple with commas.
blockDisposablebooleanoptReject throwaway / temporary email services (Mailinator, Guerrilla Mail, 10MinuteMail, and 10,000+ others).
blockFreebooleanoptReject free consumer email providers: Gmail, Yahoo, Outlook, Hotmail, iCloud, etc. Use for B2B sign-up forms that require work emails.
redHighlightbooleanoptApply a red border and light red background to the input field when validation fails. Matches the field's existing border-radius.
showTooltipbooleanoptRender a tooltip message directly below the email input on validation failure (or success if messages.valid is set).
lang"en" | "it" | "es" | "fr" | "de"optLanguage for the built-in default messages. Ignored if you provide custom messages.* values.
messages.disposablestringoptCustom tooltip copy shown when a disposable email is detected and blockDisposable is true.
messages.freestringoptCustom tooltip copy shown when a free provider is detected and blockFree is true.
messages.validstringoptOptional success message shown below the input when the email passes all checks. Leave empty to show nothing on success.
messages.warningstringoptShown for catch-all or risky emails that pass but may have deliverability issues.
onValid(e: { email: string; result: object }) => voidoptCallback fired when an email passes all validation checks. Use to unlock form submit or show custom UI.
onInvalid(e: { email: string; reason: string; result: object }) => voidoptCallback fired when an email is blocked. reason is one of: 'disposable' | 'free' | 'invalid'. Use to disable form submit.
onWarning(e: { email: string; result: object }) => voidoptCallback fired for risky emails that are not outright blocked (catch-all, role accounts).
<!-- 1. Load the widget script -->
<script src="https://api.verifox.ai/v1/widget/widget.js"></script>
<!-- 2. Initialize with your config -->
<script>
Verifox.init({
apiKey: "vfx_your_widget_key",
blockDisposable: true,
blockFree: false,
showTooltip: true,
redHighlight: true,
lang: "en",
messages: {
disposable: "Disposable emails are not allowed.",
free: "Please use a work email address.",
valid: "Email looks good!",
warning: "This email may not be deliverable."
},
onValid: function(e) { console.log("valid", e.email); },
onInvalid: function(e) { console.log("blocked", e.email, e.reason); }
});
</script>// widget.js returns the FoxGuard JavaScript SDK.
// Once loaded, window.Verifox is available with these methods:
Verifox.init(options) // Initialize — call once on page load
Verifox.reattach() // Re-scan DOM for new inputs (SPA use)
Verifox.validate(email) // Manually validate an email string
Verifox.destroy() // Remove all listeners and tooltips