fingerprintjs/fingerprintjs-pro-spa

FPJSAgent hasn't loaded yet. Make sure to call the init() method first.

Closed this issue · 2 comments

We are definitely calling the init() method first before calling getVisitorData but maybe it has more to do with NextJS SSR and hydration? We aren't using the react sdk because we need access to the client outside of the react rendering lifcycle for networking to add some headers to requests.

Hi @kdawgwilk, I can think of two possible issues:

  • Make sure you call init with await: await fpjsClient.init(). It's an async function that loads the latest fingerprinting logic from our CDN, you must wait for the network request to finish.
  • Make sure you are initializing the client and fingerprinting only the client, not on the server or at build time, you can find more information and examples in our documentation: https://dev.fingerprint.com/docs/usage-with-server-side-rendering-frameworks

If none of these resolve the issue, please post an expanded example indicating where in the Next.js lifecycle you are using the Fingerprint agent, thank you!

Closing as answered.