Skip to main content

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 included

Installation

Quick Start

VouchProvider

Wrap your app with VouchProvider to enable Vouch throughout your component tree:

Props

projectId
string
required
Your Vouch project ID
apiKey
string
required
Your client API key
options
object
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

validate
function
Function to validate an email. Returns the validation response.
loading
boolean
Whether validation is in progress
data
ValidationResponse | null
Validation response (null if not yet validated). Contains checks, metadata, recommendation, and signals.
error
Error | null
Error if validation failed
reset
function
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

Place VouchProvider at your app’s root for consistent access:
Always show loading feedback during validation:
Clear validation state after successful submission:
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