Skip to main content

Overview

The Vouch Next.js SDK provides seamless integration for both client and server components with automatic fingerprinting and optimized for Next.js App Router and Pages Router.
Package: @vouch-in/next Next.js Version: 13+ (App Router) or 12+ (Pages Router) TypeScript: Full type definitions included

Installation

App Router (Next.js 13+)

Server Component

Client Component

Pages Router (Next.js 12)

API Route

Client Page

Environment Variables

Use NEXT_PUBLIC_ prefix only for client keys. Never expose server keys!

Middleware

Validate emails in Next.js middleware:

Server Actions (Next.js 14+)

API Types

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.

Next Steps

React SDK

React hooks details

Node.js SDK

Server-side SDK