Overview
The Vouch React SDK provides hooks and components for seamless email validation in React applications with automatic device fingerprinting.Package:
@vouch-in/react
React Version: 16.8+ (hooks required)
TypeScript: Full type definitions includedInstallation
Quick Start
VouchProvider
Wrap your app withVouchProvider to enable Vouch throughout your component tree:
Props
Your Vouch project ID
Your client API key
Optional configuration:
endpoint- API endpoint URL (default: “https://api.vouch.expert”)apiVersion- API version number or “latest” (default: “latest”)
useValidateEmail()
Primary hook for email validation:Return Values
Function to validate an email. Returns the validation response.
Whether validation is in progress
Validation response (null if not yet validated). Contains
checks, metadata, recommendation, and signals.Error if validation failed
Reset state to initial values
ValidationResponse Type
The
message field contains a human-friendly error message when the recommendation is flag or block (e.g. “Please use a permanent email address, not a temporary one.”). It is null when the recommendation is allow.useVouch()
Access the Vouch instance directly:useFingerprint()
Hook to generate and access device fingerprint:Complete Examples
Full Signup Form
Real-time Validation
TypeScript
Next.js Integration
Best Practices
Wrap at Root Level
Wrap at Root Level
Place
VouchProvider at your app’s root for consistent access:Handle Loading States
Handle Loading States
Always show loading feedback during validation:
Reset After Submit
Reset After Submit
Clear validation state after successful submission:
Debounce Real-time Validation
Debounce Real-time Validation
Avoid validating on every keystroke:
Next Steps
Next.js SDK
Next.js-specific integration
JavaScript SDK
Vanilla JavaScript SDK
Best Practices
Production optimization
API Reference
Complete API docs