Skip to main content

JavaScript SDK Quickstart

The Heuristik JavaScript SDK gives you full control over the verification flow with a typed API.

Integration flow​

Installation​

npm install @heuristik/sdk

Basic usage​

verification.ts
import { HeuristikClient, Locale } from '@heuristik/sdk';

const client = new HeuristikClient({
apiKey: 'sk_sandbox_your_key_here',
});

const session = await client.createSession({
referenceId: 'user-12345',
locale: Locale.ES,
metadata: {
source: 'web',
campaign: 'onboarding',
},
});

console.log('Initialize with token:', session.token);
TypeScript support

The SDK is written in TypeScript and provides full type definitions out of the box. No need to install @types packages.

Next steps​