API Reference

getDeviceId

The fastest path to a cross-browser device hash. Skips all engine-bound collectors and returns a hardware fingerprint stable across Chrome, Safari, Firefox, and Brave.

Signature
getDeviceId(options?: FingerprintOptions): Promise<DeviceIdResult>

Returns: A DeviceIdResult containing the hardware device hash (id), collection confidence, signal-level detail, and the three risk-track results.

What it does

getDeviceId forces the binding filter to hardware-only regardless of anything in the options argument. Engine-bound collectors — audio, canvas, WebGL params, math, and others — are skipped entirely. Only the five hardware-bound signals (fonts, webgl_gpu_identity, platform, timezone, and any hardware-tier-2 signals you opt in to) are collected.

The result is faster (~200–300 ms vs ~1–1.5 s for getFingerprint) and produces a hash that does not change when the user switches browsers, opens an incognito window, or clears their browser cache. On any uncaught error the function returns an empty DeviceIdResult rather than throwing.

When to use it

Use getDeviceId whenever you need to identify the physical device rather than a specific browser session. Common cases: MFA step-up (has this user authenticated from this device before?), cross-browser device linking (same hardware seen in Chrome and Safari?), and software license enforcement (is this device already registered?).

When you also need browser-level signals — spoofing detection, bot detection, or distinguishing two users sharing the same machine — use getFingerprint instead, which runs the full pipeline and returns both hashes.

Return shape

DeviceIdResult is a focused subset of FingerprintResult. The id field is the hardware hash. The signals map contains only the hardware signals that were collected; raw values appear only when debug: true is set.

DeviceIdResult fields

FieldTypeDescription
idstring16-char hex hardware fingerprint. Same value as hardwareFingerprint in FingerprintResult.
confidencenumber0.0–1.0 collection quality score derived from the cross-browser hardware hash.
stableSignalsstring[]Signal names that contributed to the hardware hash.
unstableSignalsstring[]Signal names that were collected but excluded from the hardware hash.
consistencyConsistencyResultAnti-detect browser detection — spoofLikelihood and flags.
incognitoIncognitoResultPrivate-mode detection — incognitoLikelihood and flags.
automationAutomationResultAutomation-framework detection — automationLikelihood and flags.
collectionTimeMsnumberWall-clock time the hardware collection pass took.
versionstringLibrary version string.
signalsRecord<string, SignalResult>Per-signal result map. Hardware signals only.
typescript
import { getDeviceId } from 'doorman-benny';

const { id, confidence, consistency, incognito } = await getDeviceId();

// Use id as a stable device identifier — consistent across browsers and incognito.
console.log(id);           // "7c2e9a4b8f1d6e3a"
console.log(confidence);   // 0.82

// Check for anti-detect tooling even on the hardware path.
if (consistency.spoofLikelihood === 'high') {
  flagForReview('Anti-detect browser on hardware collection');
}

// Opt in to tier 2 for media_devices coverage.
const result2 = await getDeviceId({ tiers: [1, 2] });
console.log(result2.id);

getDeviceId accepts the same FingerprintOptions as getFingerprint. The bindings filter is forced to hardware-only and cannot be overridden.