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

fraud-buster-client

v1.1.0

Published

A React-compatible client for the Fraud Buster API by Hive Forensics A.I. Inc.

Downloads

12

Readme


Fraud Buster Client

A modern client library for integrating Hive Forensics A.I. Inc.'s Fraud Buster API into your Node.js or React projects. This package provides a simple and efficient way to connect to the API, submit transaction details, and receive real-time risk assessments.


Features

  • Lightweight and optimized for both Node.js and browser environments (React compatible).
  • Supports fraud detection for transactions.
  • Simple integration using async/await.
  • Built-in error handling for robust production deployments.

Installation

Install the package via npm:

npm install fraud-buster-client

Configuration

Set the API URL and API key in your environment variables.

Example .env file for Node.js or React projects:

FRAUD_BUSTER_URL="http://localhost:8000/api/transaction"
API_KEY="your-api-key-here"

Alternatively, you can pass the API URL and API key directly when creating the client instance.


Usage

React Frontend Example

  1. Import and initialize the client:
import FraudBusterClient from 'fraud-buster-client';

const fraudClient = new FraudBusterClient({
  apiKey: process.env.API_KEY, // Environment variable
});
  1. Evaluate a transaction:
(async () => {
  try {
    const transactionData = {
      product: "Rolex Watch",
      amount: 9500,
      location: "Florida",
      time: "2024-03-04T10:30:00Z",
      customerProfile: "Tech Enthusiast",
      onlinePurchase: true,
      paymentMethod: "Amex",
      shippingAddress: "PO BOX 8877 Los Angeles CA 90210",
      billingAddress: "2125 SW 955 Ave Miami Florida 33156",
      customerEmail: "sam@protonmail.com",
      customerName: "Steven Smith",
      isVPN: false,
      clientBrowser: "Chrome",
      deviceType: "Desktop",
      ipAddress: "192.168.1.186",
      deviceFingerprint: "abcd1234efgh5678",
      transactionFrequency: 2,
      accountAge: 365,
      emailDomain: "protonmail.com",
      addressMismatch: true,
      twoFactorAuth: false,
      referralSource: "Google Search",
      proxyOrVPN: true,
      orderQuantity: 1,
      strictness: 50
    };

    const response = await fraudClient.evaluateTransaction(transactionData);
    console.log("Fraud Assessment Result:", response);
  } catch (error) {
    console.error("Error:", error.message);
  }
})();

Node.js Backend Example

const FraudBusterClient = require('fraud-buster-client');

const fraudClient = new FraudBusterClient({
  apiKey: process.env.API_KEY,
  apiUrl: process.env.FRAUD_BUSTER_URL,
});

(async () => {
  try {
    const transactionData = { 
      product: "MacBook Pro",
      amount: 2500,
      paymentMethod: "Visa",
      ipAddress: "192.168.1.100",
      onlinePurchase: true
    };

    const response = await fraudClient.evaluateTransaction(transactionData);
    console.log("Fraud Assessment Result:", response);
  } catch (error) {
    console.error("Error:", error.message);
  }
})();

Response Format

A typical API response includes:

{
  "transactionId": "821c09c1-fdaa-4199-b3ea-c4b715f8a150",
  "ConfidenceLevel": "Medium",
  "Result": "Failed"
}

Risk Level Definitions

| Risk Level | Description | |----------------|-------------------------------------------| | 0 | Critical Risk - Immediate Failure | | 1 | High Risk - Manual Verification Required | | 2 | Failed | | 3 | Monitor Closely - Review Logs | | 4 | Low Risk - Auto Approved | | 5 | Safe Zone - Pass | | 6 | Caution - Review Recommended | | 7 | Additional Verification Needed (Fallback) |


License

This package is licensed under the MIT License. See the LICENSE file for details.


About

Developed by Hive Forensics A.I. Inc.
Visit us at hiveforensics.com


Key Updates

  1. Standardized Environment Variables

    • Replaced REACT_APP_FRAUD_BUSTER_URLFRAUD_BUSTER_URL for consistency in Node.js and React.
  2. Enhanced Error Handling

    • The API client now logs errors before rethrowing them for better debugging.
  3. Updated Example Code

    • Made frontend and backend examples clearer.