Repository navigation
1.1.0
useThisHook v1.1.0
Released: 2026-10-06
npm: usethishook@1.1.0
Compare: v1.0.0...v1.1.0
Highlights
This minor release adds useFingerprint: a typed, zero-dependency hook that builds a client-side visitor id from browser signals. No API key, no network request, and not the commercial Fingerprint Identification product.
Use it for anonymous personalization hints, correlating sessions without cookies, or lightweight abuse signals — treating the id as a hint, not a hard identity.
Live demo & API: usethishook.mentorbridge.in/useFingerprint
Added — useFingerprint(options?)
Signature
useFingerprint(options?: { enabled?: boolean }): {
visitorId: string | null;
components: FingerprintComponents | null;
isPending: boolean;
error: Error | null;
refresh: () => Promise<string | null>;
}Options
| Option | Type | Default | Description |
|---|---|---|---|
enabled |
boolean |
true |
When false, skip auto-run on mount; call refresh() yourself. |
Return values
| Field | Type | Description |
|---|---|---|
visitorId |
string | null |
Hex hash of collected signals, or null before the first successful run. |
components |
FingerprintComponents | null |
Named browser signals that went into the hash. |
isPending |
boolean |
true while identification is running. |
error |
Error | null |
Set when collection throws unexpectedly. |
refresh |
() => Promise<string | null> |
Re-run identification; returns the new visitor id (or null). |
Exported types
UseFingerprintOptionsUseFingerprintReturnFingerprintComponents
Signals collected (into components, then hashed):
- Environment:
userAgent,language,languages,platform, timezone / offset - Display:
colorDepth,screenResolution,availableScreenResolution - Device:
deviceMemory,hardwareConcurrency, touch support /maxTouchPoints,pdfViewerEnabled - Storage / privacy:
sessionStorage,localStorage,indexedDB,cookieEnabled,doNotTrack - Graphics: canvas data URL, WebGL vendor/renderer string
Hashing uses an FNV-1a–style 32-bit hex id (FingerprintJS-style client hash). Collection yields one tick so canvas/WebGL work does not block the current frame. Concurrent / unmounted runs are ignored via a run-id guard. On the server (window missing), refresh() returns null.
Example
import { useFingerprint } from 'usethishook';
export const VisitorBadge = () => {
const { visitorId, isPending, error, refresh } = useFingerprint();
if (isPending) return <p>Identifying…</p>;
if (error) return <p>Could not fingerprint: {error.message}</p>;
return (
<div>
<code>{visitorId}</code>
<button type="button" onClick={() => void refresh()}>
Refresh
</button>
</div>
);
};Deferred start
const { visitorId, refresh, isPending } = useFingerprint({ enabled: false });
// later, e.g. after consent:
await refresh();Important caveats
- Client-only fingerprinting. Identical or locked-down browsers can share or churn ids.
- Not Fingerprint Identification (SaaS). No cloud matching, no API key, no network.
- Privacy-focused browsers may reduce entropy — treat
visitorIdas a soft signal. - Playground may also use separate commercial Fingerprint wiring for the site itself; that is not part of the
usethishookpackage API.
Docs & playground
- New Browser catalog entry for
useFingerprint - Live demo, copy-paste example, and full API reference page
- Sitemap / SEO coverage for the new hook route
Upgrade
npm i usethishook@1.1.0- From 1.0.0: additive only — no breaking API changes in the published hook surface.
- Requires React 18+ (peer), Node ≥ 20 for tooling/publish (unchanged).
Links
Out of scope for this npm release: usethishook-mcp is still listed under Unreleased in CHANGELOG.md (separate MCP package). Vercel Analytics / Speed Insights are playground-only and do not ship inside usethishook.