Install & configure
The JavaScript SDK ships as
@drukverify/ekyc-sdk-js,
a universal (browser + Node.js) client with zero runtime dependencies.
The current release is 0.5.0.
Install
npm add @drukverify/ekyc-sdk-js
# or
pnpm add @drukverify/ekyc-sdk-js
# or
yarn add @drukverify/ekyc-sdk-js
Offline / mirrored installs
For air-gapped builds or an internal artifact repository, pull the checksummed tarball from the GitHub release, verify it, and install locally:
shasum -a 256 -c SHA256SUMS
npm install ./drukverify-ekyc-sdk-js-0.5.0.tgz
Configure a client
import { EkycClient } from "@drukverify/ekyc-sdk-js";
const client = new EkycClient({
baseUrl: "https://api.drukverify.com", // required, no trailing slash
apiKey: credential, // see below
version: "2026-05-12", // Drukverify-Version header (default shown)
timeout: 90_000, // needed for chained fraud plus OCR
});
Use at least 90 seconds when calling the fraud route: it runs OCR before
the fraud analysis, and real-document OCR can take up to a minute. Passing
ocrId from a scan of the same files skips that OCR pass.
Pass the capture as the device saved it. Resizing or re-encoding it in the browser removes the container, EXIF and screen-size evidence the fraud checks use to recognise screenshots; the platform resizes internally.
Authentication: browser vs server
- Server-side (Node): use your secret key (
dv_sk_…) directly asapiKey. - Browser: never embed a secret key. Your backend exchanges the secret
key for a short-lived session token via
POST /v1/sessionsand hands the resultingdv_tok_…to the page:
const { token } = await fetch("/your-backend/session").then((r) => r.json());
const client = new EkycClient({
baseUrl: "https://api.drukverify.com",
apiKey: token,
});
The SDK stores nothing in the browser, no cookies and no localStorage; the token lives in JS memory only.
Supported environments
Node.js 18+ and the last two major versions of Chrome, Edge, Firefox and Safari (15+). Camera capture requires a secure context (HTTPS).