npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@keverdjs/fraud-sdk

v1.0.0

Published

Vanilla JavaScript SDK for Keverd fraud detection and device fingerprinting

Readme

@keverdjs/fraud-sdk

Vanilla JavaScript SDK for Keverd fraud detection and device fingerprinting. Works in any JavaScript environment (browser, Node.js, etc.).

Installation

npm install @keverdjs/fraud-sdk

Quick Start

import { Keverd } from '@keverdjs/fraud-sdk';

// Initialize with API key
Keverd.init('your-api-key');

// Get visitor data and risk assessment
const result = await Keverd.getVisitorData();

console.log('Risk Score:', result.risk_score);
console.log('Action:', result.action);
console.log('Session ID:', result.session_id);

With Configuration Object

import { Keverd } from '@keverdjs/fraud-sdk';

// Initialize with configuration
Keverd.init({
  apiKey: 'your-api-key',
  endpoint: 'https://app.keverd.com', // Optional
  debug: true, // Optional: enable debug logging
});

// Get visitor data
const result = await Keverd.getVisitorData();

API Reference

Keverd.init(config)

Initialize the SDK with your API key.

Parameters:

  • config (string | SDKConfig): API key string or configuration object

Example:

// Simple initialization
Keverd.init('your-api-key');

// With options
Keverd.init({
  apiKey: 'your-api-key',
  endpoint: 'https://app.keverd.com',
  userId: 'optional-user-id',
  debug: false
});

Keverd.getVisitorData()

Get visitor data and risk assessment. This is the main method for fraud detection.

Returns: Promise

Example:

const result = await Keverd.getVisitorData();

// Result structure:
// {
//   risk_score: 25,           // 0-100
//   score: 0.25,              // 0.0-1.0
//   action: 'allow',          // 'allow' | 'soft_challenge' | 'hard_challenge' | 'block'
//   reason: ['new_user'],     // Array of risk reasons
//   session_id: 'uuid',       // Session identifier
//   requestId: 'uuid',        // Request identifier
//   sim_swap_engine: {...}    // SIM swap detection results (null for web)
// }

Keverd.createTransactionID(metadata?)

Legacy method for backward compatibility. Returns the session ID from getVisitorData().

Parameters:

  • metadata (TransactionMetadata, optional): Transaction metadata

Returns: Promise - Session ID

Example:

const transactionId = await Keverd.createTransactionID({
  amount: 1000,
  currency: 'KES',
  recipient: '254712345678'
});

Keverd.destroy()

Destroy the SDK instance and stop all data collection.

Example:

Keverd.destroy();

Response Structure

interface FingerprintResponse {
  risk_score: number;        // 0-100 risk score
  score: number;             // 0.0-1.0 normalized score
  action: 'allow' | 'soft_challenge' | 'hard_challenge' | 'block';
  reason: string[];          // Array of risk reasons
  session_id: string;        // UUID session identifier
  requestId: string;         // UUID request identifier
  sim_swap_engine?: {        // SIM swap detection (null for web SDKs)
    userId?: string;
    risk: number;
    flags: {
      sim_changed?: boolean;
      device_changed?: boolean;
      behavior_anomaly?: boolean;
      time_anomaly?: boolean;
      velocity_anomaly?: boolean;
    };
    updatedProfile?: Record<string, unknown>;
  };
}

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT

Support

For issues, questions, or contributions, please visit the GitHub repository.