You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are migrating from FingerprintJS V2 to V5. With V2, we were able to attach the browser fingerprint (BFP) to every request.
With V5’s async nature, we are facing issues where requests are sent before the fingerprint is ready, and in some cases we also need to re-generate BFP since we don’t rely on consistent client-side storage.
This is mainly due to fingerprint generation latency + async execution, where:
Request lifecycle progresses faster than fingerprint resolution
No reliable synchronous fallback exists
Re-generation causes timing gaps again
Requirement:
BFP must be sent with every request to validate request authenticity and detect malicious traffic.
Concern:
If BFP is missing and read from stored locations (cookie/window/etc), an attacker can send an empty/tampered request, and the system may fallback to stored value — creating a security gap.
What we explored:
Early initialization → still misses early requests
Async request gating → not feasible as we are in older version, await not supported
In-memory storage → not reliable across flows
Client-side storage (cookie/localStorage) → security risk
Reducing entropy → no meaningful latency improvement
Ask:
How to ensure BFP is available and attached to every request, including early + regenerated flows?
What is the secure pattern to handle async generation without relying on stored values?
V5’s get() returns a Promise, so you can’t reliably attach the visitor ID right at call time. The usual fix is to wrap transport. Initialise the FP agent early in app start, stash the pending Promise in a singleton, then let your request layer wait on it. Once that Promise settles, requests continue with the ID attached. In older codebases this still works with a thin interceptor around XMLHttpRequest or a fetch helper that pauses until the cached Promise resolves.
On the security side, treat “no BFP yet” as unauthenticated. Don’t fall back to cookies or localStorage. Just delay. I’ve also seen a bootstrap request work: resolve the fingerprint first, return a short‑lived server nonce, bind later requests to that pair.
Sorry for a late reply, but can you please be more specific about the environment where you are running Fingerprint? Is it IE 11 (as you mentioned legacy system)
With V5’s async nature, we are facing issues where requests are sent before the fingerprint is ready, and in some cases we also need to re-generate BFP since we don’t rely on consistent client-side storage.
Can you please provide a code snippet (it can be a pseudo code as well) how exactly you were using v2 and how you use v5? Unfortunately we don't have the migration docs from v2 to v5 but the v5 API is very similar to v3 API which you can see here -> https://github.com/fingerprintjs/fingerprintjs/blob/v3/docs/migrating_v2_v3.md#initialization (this is the migration docs from v2 to v3, so it is kinda relevant to the as you can see how exactly you are suppose to migrate)
No reliable synchronous fallback exists
I don't get it as v2 was also not synchronous (this is how it was supposed to be used):
if(window.requestIdleCallback){requestIdleCallback(function(){Fingerprint2.get(function(components){console.log(components)// an array of components: {key: ..., value: ...}})})}else{setTimeout(function(){Fingerprint2.get(function(components){console.log(components)// an array of components: {key: ..., value: ...}})},500)}
@GoldStrikeArch
I don't get it as v2 was also not synchronous (this is how it was supposed to be used):
We tried doing the same mentioned in https://github.com/fingerprintjs/fingerprintjs/blob/v3/docs/migrating_v2_v3.md#initialization
but we see that after migration few request doesn't have BFP because the BFP is not ready by the time.
While that never happens for V2, It just generated in time to be attached to the request, This happens for page refresh, iframe reload or any other UI action.
In V2 we had excluded few of the heavy component, I am not sure if that is the reason of it appearing to be sync. Below is our code
for v2
Fingerprint2.get(options, function(components) {
var values = components.map(function(component) {
return component.value;
});
var fingerprintToken = Fingerprint2.x64hash128(values.join(''), 31);
window.browserFingerprint = fingerprintToken;
});
We are loading the bfp on very initial loads but stills when window object resets the bfp generation will be called again and if not generated then it will unauthenticate the user. That is our major concern.
I suspect it is because V5 has 2 promise that's take longer to execute and we have the request that has undefined bfp??
Can you help me understand why everything was working in V2 and starting breaking after migration to V5???
We have just modified the code as mentioned in the migration doc v2 to v3.
@sophymarine , Can you give me more detail about below approach??
Just delay. I’ve also seen a bootstrap request work: resolve the fingerprint first, return a short‑lived server nonce, bind later requests to that pair.
// Initialize once, before scripts that send protected requests.window.browserFingerprintReady=FingerprintJS.load().then(function(fp){returnfp.get()}).then(function(result){// This customizes the hash, but doesn't skip source collection.constcomponents=getRemaining(result.components)returnFingerprintJS.hashComponents(components)})// Every protected request must wait for the same shared Promise.functionwithBrowserFingerprint(send){returnwindow.browserFingerprintReady.then(function(bfp){returnsend(bfp)})}withBrowserFingerprint(function(bfp){returnfetch('/api/action',{method: 'POST',headers: {'X-BFP': bfp},})}).catch(function(error){console.error('Protected request failed',error)})
So, basically you have a shared promise attached on window object which performs the FingerprintJS.load(). In this way you should not miss the requests without visitor id
Activity
Huaian666 commentedon Jun 13, 2026
hmm interesting approach. different from what ive seen before. digging into the source
gautam16kr commentedon Jun 13, 2026
also we cannot have gating as there is no one script sending request to server. We have legacy system so changing multiple script would be a concer
sophymarine commentedon Jun 19, 2026
V5’s
get()returns a Promise, so you can’t reliably attach the visitor ID right at call time. The usual fix is to wrap transport. Initialise the FP agent early in app start, stash the pending Promise in a singleton, then let your request layer wait on it. Once that Promise settles, requests continue with the ID attached. In older codebases this still works with a thin interceptor aroundXMLHttpRequestor a fetch helper that pauses until the cached Promise resolves.On the security side, treat “no BFP yet” as unauthenticated. Don’t fall back to cookies or localStorage. Just delay. I’ve also seen a bootstrap request work: resolve the fingerprint first, return a short‑lived server nonce, bind later requests to that pair.
GoldStrikeArch commentedon Jun 19, 2026
Hi @gautam16kr!
Sorry for a late reply, but can you please be more specific about the environment where you are running Fingerprint? Is it IE 11 (as you mentioned
legacy system)Can you please provide a code snippet (it can be a pseudo code as well) how exactly you were using v2 and how you use v5? Unfortunately we don't have the migration docs from v2 to v5 but the v5 API is very similar to v3 API which you can see here -> https://github.com/fingerprintjs/fingerprintjs/blob/v3/docs/migrating_v2_v3.md#initialization (this is the migration docs from v2 to v3, so it is kinda relevant to the as you can see how exactly you are suppose to migrate)
I don't get it as v2 was also not synchronous (this is how it was supposed to be used):
gautam16kr commentedon Jun 23, 2026
@GoldStrikeArch
I don't get it as v2 was also not synchronous (this is how it was supposed to be used):
We tried doing the same mentioned in https://github.com/fingerprintjs/fingerprintjs/blob/v3/docs/migrating_v2_v3.md#initialization
but we see that after migration few request doesn't have BFP because the BFP is not ready by the time.
While that never happens for V2, It just generated in time to be attached to the request, This happens for page refresh, iframe reload or any other UI action.
In V2 we had excluded few of the heavy component, I am not sure if that is the reason of it appearing to be sync. Below is our code
for v2
Our code for V5
We are loading the bfp on very initial loads but stills when window object resets the bfp generation will be called again and if not generated then it will unauthenticate the user. That is our major concern.
I suspect it is because V5 has 2 promise that's take longer to execute and we have the request that has undefined bfp??
Can you help me understand why everything was working in V2 and starting breaking after migration to V5???
We have just modified the code as mentioned in the migration doc v2 to v3.
@sophymarine , Can you give me more detail about below approach??
Just delay. I’ve also seen a bootstrap request work: resolve the fingerprint first, return a short‑lived server nonce, bind later requests to that pair.
GoldStrikeArch commentedon Jul 19, 2026
@gautam16kr
I think this is the pattern you want to use:
So, basically you have a shared promise attached on
windowobject which performs theFingerprintJS.load(). In this way you should not miss the requests without visitor id