vouch.fraud.assess() or vouch.escrow.assess(), and sends it along with the request in the background.
How it works in the browser
In a browser environment, Vouch uses FingerprintJS to generate avisitorId — a stable string that represents the current device and browser profile. This value is collected once per session and cached in memory, so subsequent SDK calls reuse the same identifier without triggering additional computation or network requests.
How it works in Node.js
In a Node.js or server-side environment, there is no browser context to fingerprint. The SDK returns the static string'node-server-fingerprint' instead. This placeholder is recognized by the Vouch API and handled appropriately — server-side requests are assessed using the other signals in the payload rather than device characteristics.
Using getDeviceFingerprint() directly
If you need the raw fingerprint value in your own application logic — for example, to log it alongside a session record or pass it to a separate analytics service — you can import and call getDeviceFingerprint() directly.
Promise<string>. In the browser, it resolves to the FingerprintJS visitorId. In Node.js, it resolves immediately to 'node-server-fingerprint'.
The result of
getDeviceFingerprint() is cached in memory for the lifetime of the current JavaScript session. Calling it multiple times returns the same value without re-running the fingerprinting computation.Testing with a mock fingerprint
When writing unit tests or running in a CI environment, you likely want a deterministic, controllable fingerprint rather than a real one. SetglobalThis.MOCK_FINGERPRINT to any string before making SDK calls, and the SDK will use that value instead of computing a real fingerprint.