Skip to main content
This guide walks you through everything you need to make your first Vouch API calls — from installing the package to handling a real fraud assessment response. By the end you will have a working integration you can build on.
1

Install the SDK

Add vouch-sdk to your project using your preferred package manager.
The package targets ESM and ships with full TypeScript type definitions — no @types/vouch-sdk package required.
2

Get your API key

Every request to Vouch requires an API key. To get one:
  1. Sign up for a Vouch developer account at the Vouch dashboard.
  2. Navigate to Settings → API Keys and click Generate new key.
  3. Copy the key — it will only be shown once.
Store the key as an environment variable so it never appears in your source code.
.env
Never hard-code your API key in your source files or commit it to version control. If you are building a client-side application, proxy all Vouch calls through a server-side function so the key stays out of the browser bundle.
3

Initialize the SDK

Import the default export from vouch-sdk and create a client instance, passing your API key from the environment.
The constructor accepts the API key as its first argument and an optional options object as its second. The SDK stores the key and attaches it as the x-api-key header on every outbound request — you never need to manage authentication manually.
The SDK reads the VOUCH_API_URL environment variable automatically at start-up. Set it to override the default base URL (https://vouch-fmql.onrender.com/v1) without changing any code — for example when pointing at a local proxy or a staging environment: VOUCH_API_URL=https://staging.example.com/v1. You can also pass options.apiUrl to the constructor for the same effect.
4

Run your first identity check

Call vouch.identity.verify with the ID your platform uses to identify the user. Vouch opens a guided KYC modal that walks the user through document capture and liveness detection — you just handle the result.
The verify method returns a promise that resolves once the user completes (or exits) the KYC flow. The result.status field reflects the outcome: verified, pending, or failed.
5

Assess fraud risk

Before processing a transaction, pass the relevant signals to vouch.fraud.assess. The AI engine returns a flag of GREEN, AMBER, or RED that you can use to gate your business logic.
The assessment.triggeredSignals array lists the specific factors that influenced the score, so you can surface actionable context in your internal tooling or user-facing messages.

Next steps

Now that your integration is working, explore the rest of the SDK.

Identity

Learn about direct document uploads and how to retrieve verification results asynchronously.

Fraud Detection

See the full list of signals you can pass to fraud.assess and how to tune thresholds.

Escrow

Create milestone-based escrow accounts and manage the full release lifecycle.