> ## Documentation Index
> Fetch the complete documentation index at: https://developer.keverd.com/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript SDK

> Vanilla JS / CDN with @keverdjs/agent

# JavaScript SDK

## Install

```bash theme={null}
npm install @keverdjs/agent
```

CDN: `https://cdn.keverd.com/sdk/v1/keverd-sdk.min.js` → `window.Keverd`

## Initialize

```js theme={null}
import { Keverd } from '@keverdjs/agent';

Keverd.init('kv_pk_live_…');
// or
Keverd.init({
  apiKey: 'kv_pk_test_…',
  endpoint: 'https://api.keverd.com',
});
```

## Collect

```js theme={null}
const result = await Keverd.getVisitorData();

console.log(result.event_id);     // send to your server
console.log(result.fingerprint);
console.log(result.action);       // allow | soft_challenge | hard_challenge | block
console.log(result.risk_score);
```

<Warning>
  Do not use `Keverd.get()` for the verify flow. It returns a **string**, not an object with `event_id`.
</Warning>

## Optional use-case helpers (public key — still collection)

```js theme={null}
await Keverd.verifyLogin({ /* … */ });
await Keverd.verifyCheckout(amount, currency);
await Keverd.verifyRegistration();
await Keverd.verifyPasswordReset();
await Keverd.verifyAccountChange();
```

These do **not** replace server `verify()`.

## Next

[Verify on the server →](/server/overview)
