Skip to main content

Overview

The Vouch JavaScript SDK provides email validation and device fingerprinting for browser-based applications. It’s framework-agnostic and works with any JavaScript project.
Package: @vouch-in/js Browser Support: All modern browsers (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)

Installation

Quick Start

Initialization

Basic Initialization

With Options

Device fingerprinting starts automatically when the Vouch instance is created. This ensures the fingerprint is ready when you call validate().

Core Methods

validate()

Validate an email address with automatic device fingerprinting:
Parameters:
email
string
required
Email address to validate
options
object
Optional validation request options:
  • fingerprintHash - Override the auto-generated fingerprint hash
  • ip - Client IP address (usually set server-side)
  • userAgent - Client user agent (usually set server-side)
Returns: Promise<ValidationResponse>
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.

generateFingerprint()

Get the device fingerprint directly:
Returns: Promise<Fingerprint>

Usage Examples

Form Validation

Real-time Validation

Check Specific Validations

Error Handling

Advanced Features

Custom Validation Logic

Batch Validation

Retry Logic

TypeScript Support

The SDK is written in TypeScript and includes full type definitions:

Browser Compatibility

For older browsers, use a polyfill for fetch and Promise.

Common Patterns

Vue.js

Svelte

Next Steps

React SDK

React hooks and components

Node.js SDK

Server-side validation

API Reference

REST API documentation

Best Practices

Production deployment tips