Install the package
Initialize the client
Import theVouch 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.
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 readsVOUCH_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 yourtsconfig.json targets a compatible module system:
tsconfig.json
"module": "ESNext" is the typical setting and no extra configuration is needed.
Import styles
Use the default import for theVouch class, named imports for individual interfaces and utilities, or both together: