JavaScript SDK Quickstart
The Heuristik JavaScript SDK gives you full control over the verification flow with a typed API.
Integration flowβ
Installationβ
- npm
- yarn
- pnpm
npm install @heuristik/sdk
yarn add @heuristik/sdk
pnpm add @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β
- Authentication β configure API keys
- Operations β sessions, fingerprints, and more
- Error Handling β handle errors gracefully