Skip to main content

Class: HeuristikClient

Defined in: index.ts:76

The main Heuristik SDK client.

Example​

const client = new HeuristikClient({ apiKey: 'sk_live_...' });
const session = await client.createSession({ referenceId: 'user-123' });
console.log(session.token);

Constructors​

Constructor​

new HeuristikClient(config): HeuristikClient

Defined in: index.ts:86

Creates a new Heuristik client instance.

Parameters​

config​

HeuristikConfig

Configuration options including API key

Returns​

HeuristikClient

Throws​

Error if apiKey is not provided

Methods​

createSession()​

createSession(options): Promise<Session>

Defined in: index.ts:100

Creates a new verification session.

Parameters​

options​

CreateSessionOptions

Session creation options

Returns​

Promise<Session>

The created session with a token for SDK initialization


getSession()​

getSession(sessionId): Promise<Session>

Defined in: index.ts:121

Retrieves a session by its unique identifier.

Parameters​

sessionId​

string

The UUID of the session to retrieve

Returns​

Promise<Session>

The session details