@stackonward/device-fingerprint
v0.0.2
Published
Provider-neutral browser device fingerprint engine
Maintainers
Readme
@stackonward/device-fingerprint
Provider-neutral browser device fingerprint engine built on FingerprintJS v4. It returns a stable browser signal without owning backend headers, product context, authorization, or operation idempotency.
Install
pnpm add @stackonward/device-fingerprintUsage
import { getDeviceFingerprint, resetFingerprint } from "@stackonward/device-fingerprint";
const { visitorId, confidence } = await getDeviceFingerprint();
resetFingerprint();The first call loads FingerprintJS and computes the signal. Concurrent calls
share the same in-flight operation, and the result is cached in memory for the
current page lifecycle. resetFingerprint() clears that cache so the next call
recomputes the signal.
Public API
| Export | Purpose |
| ------------------------- | ------------------------------------------------ |
| getDeviceFingerprint() | Resolve { visitorId, confidence } in a browser |
| resetFingerprint() | Clear the module's current-page cache |
| DeviceFingerprintResult | Result contract |
Trust boundary
A fingerprint is a probabilistic device signal, not authentication or proof of identity. Send it only under the privacy policy and consent requirements of the consuming application. The server must still enforce authorization and rate limits independently.
For OneX request headers, use @stackonward/onex-device-context; that adapter
maps the generic signal into the named upstream protocol.
Compatibility
- Browser runtime with FingerprintJS v4 support
- ESM with TypeScript declarations
- No server-side fingerprint implementation
