A production-grade, lightweight, and robust browser fingerprinting library written in TypeScript. It generates a stable, deterministic, and unique SHA-256 fingerprint for visitors.
- Stable: Resistant to window resizing, zooming, and screen resolution changes.
- Unique: Distinguishes between similar browsers using Canvas, WebGL, Audio, and Font signals.
- Lightweight: Zero external dependencies (uses native Web Crypto API).
- Privacy-focused: Does not use unstable or intrusive signals like screen geometry.
npm install fingerprint-libimport { generateFingerprint } from "fingerprint-lib";
// Async function to generate fingerprint
const result = await generateFingerprint();
console.log("Visitor ID:", result.id);
console.log("Details:", result.components);For more detailed examples, including integration with React, Vue, and plain HTML, see USAGE_GUIDE.md.
The generateFingerprint function returns a FingerprintResult object:
interface FingerprintResult {
id: string; // SHA-256 hash
components: { // Individual signals
hardware: { value: ... },
os: { value: ... },
canvas: { value: ... },
webgl: { value: ... },
audio: { value: ... },
fonts: { value: ... },
math: { value: ... }
};
version: string;
time: number;
}| Signal Category | Description |
|---|---|
| Hardware | Concurrency, Memory, Touch Points |
| OS/Browser | Platform, Vendor, Language, Timezone |
| Canvas | Rendering of text, emoji, and geometry |
| WebGL | GPU Vendor and Renderer strings |
| Audio | Audio processing dynamics (oscillator/compressor) |
| Fonts | Detection of installed system fonts |
| Math | Floating-point math stability checks |
-
Install dependencies:
npm install
-
Run development demo:
npm run dev
-
Build library:
npm run build
MIT