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. |
apiUrl | string | Optional · "https://api.verifox.ai" | Verifox API base URL the widget calls. Auto-detected from the widget.js <script src>, so you rarely need to set it — override only for self-hosted or proxied setups. |
selector | string | Optional · "input[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. |
blockSubmit | boolean | Optional · true | Automatically prevent the enclosing <form> from submitting while a blocked email (invalid / disposable / free) is present. Set false to handle submission yourself via onInvalid or data-verifox-status. |
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 | Show the verdict as plain text directly below the email input on validation failure (or success if messages.valid is set). Set false for icon-only. |
showIcon | boolean | Optional · true | Show a small status icon inside the right edge of the email field (checking, valid, risky, blocked, disposable). The widget adds right padding so text never runs under it. Set false for text-only. |
lang | "en" | "it" | "es" | "fr" | "de" | Optional · "en" | Language for the built-in default messages. Ignored if you provide custom messages.* values. |
messages.invalid | string | Optional · "Please enter a valid email address" | Custom tooltip copy shown when the address is not a real, deliverable email. Invalid addresses are always blocked. |
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 it 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 it 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.
apiUrlstringoptVerifox API base URL the widget calls. Auto-detected from the widget.js <script src>, so you rarely need to set it — override only for self-hosted or proxied setups.
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.
blockSubmitbooleanoptAutomatically prevent the enclosing <form> from submitting while a blocked email (invalid / disposable / free) is present. Set false to handle submission yourself via onInvalid or data-verifox-status.
redHighlightbooleanoptApply a red border and light red background to the input field when validation fails. Matches the field's existing border-radius.
showTooltipbooleanoptShow the verdict as plain text directly below the email input on validation failure (or success if messages.valid is set). Set false for icon-only.
showIconbooleanoptShow a small status icon inside the right edge of the email field (checking, valid, risky, blocked, disposable). The widget adds right padding so text never runs under it. Set false for text-only.
lang"en" | "it" | "es" | "fr" | "de"optLanguage for the built-in default messages. Ignored if you provide custom messages.* values.
messages.invalidstringoptCustom tooltip copy shown when the address is not a real, deliverable email. Invalid addresses are always blocked.
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 it 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 it 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<!-- 1. Load the widget script -->2<script src="https://api.verifox.ai/v1/widget/widget.js"></script>34<!-- 2. Initialize with your config -->5<script>6 Verifox.init({7 apiKey: "foxkey_your_full_key",8 blockDisposable: true,9 blockFree: false,10 blockSubmit: true,11 showTooltip: true,12 showIcon: true,13 redHighlight: true,14 lang: "en",15 messages: {16 disposable: "Disposable emails are not allowed.",17 free: "Please use a work email address.",18 valid: "Email looks good!",19 warning: "This email may not be deliverable."20 },21 onValid: function(e) { console.log("valid", e.email); },22 onInvalid: function(e) { console.log("blocked", e.email, e.reason); }23 });24</script>1// widget.js returns the FoxGuard JavaScript SDK.2// Once loaded, window.Verifox is available with these methods:34Verifox.init(options) // Initialize — call once on page load5Verifox.reattach() // Re-scan DOM for new inputs (SPA use)6Verifox.validate(email) // Manually validate an email string7Verifox.destroy() // Remove all listeners and tooltips