Veridi / docs

First verification in 5 minutes

Skip straight to a working KYC. Assumes you've already signed up and minted an API key.

New here? Start with the getting-started guide. This page is the compressed version for engineers who just need the snippet.

1. Install + initialize

pnpm add @veridi/sdk
import { VeridiClient } from '@veridi/sdk';

const veridi = new VeridiClient({
  baseUrl: 'https://api.veridi.id',
  apiKey: process.env.VERIDI_API_KEY!,
});

2. Initiate + upload in one go

const kyc = await veridi.kyc.initiate({
  subjectExternalRef: 'customer_001',
  type: 'INDIVIDUAL_KTP',
});

const intent = await veridi.kyc.documents(kyc.id).createUploadIntent({
  type: 'KTP',
  mimeType: 'image/jpeg',
  sizeBytes: file.size,
});

await fetch(intent.uploadUrl, {
  method: 'PUT',
  headers: intent.requiredHeaders,
  body: file,
});

await veridi.kyc.documents(kyc.id).complete(intent.id);

3. Receive the result via webhook

OCR happens asynchronously. Configure a webhook at https://app.veridi.id/webhooks for the kyc.completed event; verify the signature with veridi.webhooks.verify(rawBody, signature, secret).

Or poll, if you must

for (let i = 0; i < 10; i++) {
  const status = await veridi.kyc.getStatus(kyc.id);
  if (status === 'COMPLETED' || status === 'FAILED') break;
  await new Promise(r => setTimeout(r, 2000));
}
Polling burns rate-limit budget. Webhooks are strictly cheaper and arrive faster — use them in production.