@deepidv/server is the official backend-first TypeScript SDK for the deepidv identity verification API. It wraps every REST endpoint in a typed, autocompleting client so you can create hosted verification sessions, scan documents, compare faces, run full identity verification, and screen individuals — without hand-writing HTTP, auth, retries, or file uploads.
This is the server SDK — it holds your API key and is meant to run in a trusted backend (Node.js, Deno, Bun, or an edge runtime). Never ship it to a browser or mobile client.
Why use the SDK
- Typed end to end. Every input and result is a TypeScript type derived from a Zod schema — your editor autocompletes fields and the compiler catches mistakes before runtime.
- Thin client. The SDK validates inputs, manages
x-api-keyauth, retries transient failures, and orchestrates presigned file uploads. All verification logic runs server-side atapi.deepidv.com. - Web-standards-first. It uses only native web APIs (
fetch,AbortController,ReadableStream,Uint8Array), which is what lets it run across Node, Deno, Bun, and Cloudflare Workers. - Single dependency. The only production dependency is zod for runtime input validation.
Install
import and require both work with no extra configuration.
The DeepIDV client
The DeepIDV class is the single entry point. Construct it once with your API key and reuse it — the constructor is cheap and each instance is independent.
Namespace map
Methods are grouped by domain. Each namespace maps onto a part of the REST API:| Namespace | Methods | What it does | REST reference |
|---|---|---|---|
client.sessions | create, retrieve, list, updateStatus | Hosted verification sessions | Sessions |
client.document | scan | Document OCR / data extraction | Document Scan |
client.face | detect, compare, estimateAge | Face detection, matching, age estimate | Face |
client.identity | verify | Orchestrated document + face verification | Identity Verify |
client.screening | pepSanctions, adverseMedia, titleCheck | Silent screening (PEP/sanctions, adverse media, title check) | Silent Screening |
client.asyncJobs | get | Poll long-running async jobs | Get Async Job |
client.on(event, listener) for lifecycle events — see Async Jobs & Events.
Three service tiers
| Tier | Pattern | Methods |
|---|---|---|
| Synchronous | One call, one result. Image in, structured data out. | document.scan, face.detect, face.compare, face.estimateAge, screening.pepSanctions, screening.titleCheck |
| Orchestrated | One call, multiple operations coordinated server-side. | identity.verify |
| Session-based | Create a session, the user completes steps, you retrieve results. | sessions.create, sessions.retrieve |
| Async | Kick off a job, poll for the result. | screening.adverseMedia, asyncJobs.get |
Supported runtimes
The SDK runs anywhere with nativefetch:
| Feature | Node.js 18+ | Deno | Bun | Cloudflare Workers |
|---|---|---|---|---|
| All API methods | Yes | Yes | Yes | Yes |
| File path input | Yes | Yes | Yes | No |
Uint8Array / Buffer input | Yes | Yes | Yes | Yes |
ReadableStream input | Yes | Yes | Yes | Yes |
| Base64 / data URL input | Yes | Yes | Yes | Yes |
| ESM import | Yes | Yes | Yes | Yes |
| CJS require | Yes | N/A | Yes | N/A |
fetch. On edge runtimes there is no filesystem, so pass a Uint8Array or ReadableStream instead of a file path — see Configuration for proxy, mTLS, and service-binding fetch setups.
Next steps
Quickstart
Install, initialize, and make your first call in two minutes.
Authentication
API key setup, env vars, redaction, and custom fetch.
Session Verification
The hosted flow: create a session, let the user verify, read results.
Server-to-Server
Build a custom pipeline from the document and face primitives.
Resources
- npm:
@deepidv/server - REST API reference: docs.deepidv.com/api-reference
- Admin console: app.deepidv.com