DeepIDV constructor, with defaults and behavior.
Options
Retry & timeout behavior
Retries. The SDK automatically retries only transient failures — HTTP429 (rate limited) and 5xx (server errors). It never retries 4xx client errors, since those indicate a bug in the request that a retry won’t fix. After maxRetries attempts are exhausted, the original typed error (e.g. RateLimitError) is thrown.
A few methods opt out of retries deliberately.
screening.pepSanctions and screening.titleCheck are sent with maxRetries: 0 because the server bounds an un-cancellable upstream and returns 503 on breach without billing — an immediate retry would just hit the same slow path. See Screening.random(0, initialRetryDelay * 2^attempt). When a 429 carries a Retry-After header, that value is respected.
Timeouts. timeout and uploadTimeout are per attempt, not total — every retry gets a fresh timer. A single attempt exceeding its budget throws a TimeoutError.
You can observe retries and timing in real time via the retry and response events.
Examples
Minimal
Full configuration
No retries
Fast timeout (low-latency use case)
Custom fetch with a proxy
Cloudflare Workers service binding
Validation
All options are validated synchronously at construction time with a Zod schema (DeepIDVConfigSchema). Validation failures throw a ValidationError before any network call: