@5seg/cateye
v0.1.2
Published
Browser device fingerprinting with weighted scoring engine
Maintainers
Readme
cateye
Browser device fingerprinting with a weighted scoring engine (WASM-powered C++ core).
Installation
npm install cateyeUsage
import { Fingerprinter, serialize, deserialize } from "cateye";
const fp = new Fingerprinter({
stabilityThreshold: 0.85,
timeout: 5000,
});
// Collect fingerprint signals from the browser
const data = await fp.collect();
// Get visitor ID (hashed fingerprint)
const { id, data: fpData } = await fp.getVisitorId();
// Compare two fingerprints
const result = await fp.match(previousData, currentData);
console.log(result.confidence); // 0.0 - 1.0
console.log(result.isMatch); // true if confidence >= threshold
console.log(result.componentScores); // per-signal breakdown
// Serialize for storage/transmission
const json = serialize(data);
const restored = deserialize(json);Configuration
interface FingerprintConfig {
weights?: Record<string, number>; // per-signal weight (default: pre-tuned)
tolerances?: Record<string, number>; // per-signal match tolerance 0-1
stabilityThreshold?: number; // overall "same device" threshold (default: 0.85)
timeout?: number; // collection timeout ms (default: 5000)
customSignals?: Record<string, () => Promise<string>>; // user-defined signals
}