anti-fraud-browser-detector
v1.0.6
Published
Framework-agnostic browser anti-fraud and fingerprint detector
Maintainers
Readme
Anti Fraud Detector
A lightweight, framework-agnostic browser anti-fraud detector for collecting device signals, generating a browser fingerprint, and calculating a heuristic risk score.
This package is designed for frontend applications and can be used in:
- React
- Next.js
- Vue
- Nuxt
- Angular
- Svelte
- Vanilla JavaScript
- Vanilla TypeScript
It helps collect device and browser-related signals that can be sent to your backend for fraud analysis, login protection, suspicious activity detection, and transaction risk evaluation.
Table of Contents
Features
- Browser fingerprint generation
- Basic spoofing detection
- VPN / proxy heuristic detection
- WebGL fingerprint collection
- Canvas fingerprint collection
- Audio fingerprint collection
- Media device count detection
- Network connection information collection
- Incognito / privacy mode heuristic detection
- Simple risk scoring
- Framework-agnostic design
- Frontend-only browser package
- Works with TypeScript
- Can be integrated with backend fraud engines
Installation
Install the package from npm:
npm install anti-fraud-detectorQuick Start
import { AntiFraudDetector } from "anti-fraud-detector";
async function run() {
const detector = new AntiFraudDetector();
const result = await detector.collectData();
console.log("Fingerprint ID:", result.fingerprintId);
console.log("Risk Score:", result.riskScore);
console.log("Signals:", result.signals);
console.log("VPN Signals:", result.vpnSignals);
console.log("Raw Data:", result.raw);
}
run();Usage
React
import { useEffect } from "react";
import { AntiFraudDetector } from "anti-fraud-detector";
export default function App() {
useEffect(() => {
const run = async () => {
const detector = new AntiFraudDetector();
const result = await detector.collectData();
console.log(result);
};
run();
}, []);
return <div>Anti Fraud Detector</div>;
}VUE
<script setup lang="ts">
import { onMounted } from "vue";
import { AntiFraudDetector } from "anti-fraud-detector";
onMounted(async () => {
const detector = new AntiFraudDetector();
const result = await detector.collectData();
console.log(result);
});
</script>
<template>
<div>Anti Fraud Detector</div>
</template>Angular
import { Component, OnInit } from "@angular/core";
import { AntiFraudDetector } from "anti-fraud-detector";
@Component({
selector: "app-root",
template: `<h1>Anti Fraud Detector</h1>`,
})
export class AppComponent implements OnInit {
async ngOnInit() {
const detector = new AntiFraudDetector();
const result = await detector.collectData();
console.log(result);
}
}Vanilla
import { AntiFraudDetector } from "anti-fraud-detector";
async function run() {
const detector = new AntiFraudDetector();
const result = await detector.collectData();
console.log(result);
}
run();