Skip to main content
The Vouch SDK is a TypeScript-first package that gives your application access to identity verification, fraud assessment, and escrow primitives through a single unified client. Install it once, initialize it with your API key, and every module is available on the resulting instance.

Install the package

Initialize the client

Import the Vouch class and construct a client with your developer API key. Store the instance somewhere your application can reuse it — a singleton module, a provider, or a dependency-injection container.
You can also pass an options object to override the default API or modal URLs:

Constructor parameters

string
required
Your developer API key, obtained from the Vouch dashboard. This key is sent with every SDK request to authenticate your application.
string
Override the backend API base URL. Defaults to https://vouch-fmql.onrender.com/v1. Use this when routing requests through a proxy or when working against a self-hosted Vouch instance.
string
Override the URL of the hosted identity verification modal. Defaults to https://vouch-modal.vercel.app. Override this only if you are deploying your own modal instance.

Environment variables

The SDK automatically reads VOUCH_API_URL from the environment and uses it as the apiUrl if no explicit value is passed in options. Set this in your .env file or deployment environment to avoid hard-coding URLs:
VOUCH_API_URL is only applied when options.apiUrl is not provided. An explicit constructor option always takes precedence.

ESM configuration

The Vouch SDK ships exclusively as ES modules. If you are using TypeScript in a Node.js project, make sure your tsconfig.json targets a compatible module system:
tsconfig.json
For browser bundlers (Vite, webpack, Rollup) or Next.js projects, "module": "ESNext" is the typical setting and no extra configuration is needed.
If you see ERR_REQUIRE_ESM at runtime, your project is attempting to require() an ES module. Switch your entry point to use import syntax, or set "type": "module" in your package.json.

Import styles

Use the default import for the Vouch class, named imports for individual interfaces and utilities, or both together:
Keep a single shared vouch instance across your application rather than constructing a new one per request. The SDK is stateless with respect to individual calls, so one instance is safe to reuse in any context.