@vouch-in/js
v0.1.12
Published
Vouch SDK for JavaScript - Email validation and device fingerprinting
Readme
@vouch-in/js
Official Vouch SDK for JavaScript - Email validation and device fingerprinting for browser applications.
Installation
npm install @vouch-in/js
# or
yarn add @vouch-in/js
# or
bun add @vouch-in/jsQuick Start
import { Vouch } from "@vouch-in/js";
// Initialize with your credentials
const vouch = new Vouch("your-project-id", "your-client-api-key");
// Validate an email
const result = await vouch.validate("[email protected]");
if (result.recommendation === "allow") {
console.log("Email is valid!");
} else {
// Option 1: Use the message field for a user-friendly error
console.log(result.message); // e.g. "Please use a permanent email address, not a temporary one."
// Option 2: Check specific validations for custom messages
if (!result.checks.syntax?.pass) {
console.log("Invalid email format");
} else if (!result.checks.disposable?.pass) {
console.log("Disposable emails not allowed");
}
}Features
- Email syntax validation
- Disposable email detection
- MX record verification
- Device fingerprinting
- IP reputation checking
- Role email detection
- Alias detection
Response Structure
interface ValidationResponse {
checks: Record<string, CheckResult>;
message?: string;
metadata: {
fingerprintHash: string | null;
previousSignups: number;
totalLatency: number;
};
recommendation: "allow" | "block" | "flag";
signals: string[];
}Documentation
For complete documentation, examples, and API reference, visit:
docs.vouch.expert/sdks/javascript
Related Packages
- @vouch-in/react - React hooks and components
- @vouch-in/node - Server-side validation
- @vouch-in/next - Next.js integration
- @vouch-in/remix - Remix integration
License
Proprietary. Copyright (c) Vouch. All rights reserved.
See the SDK License Agreement for terms.
