fingerprintjs/fingerprintjs-pro-react

Can i get useVisitorData hook outside of react components?

Closed this issue · 1 comments

I have a NextJS app but need to get access to the visitor data outside react components for networking purposes. What is the recommendation to get visitor data in an app using this SDK but needing to get this info outside of a react context?

Hi @kdawgwilk! I can think of two options:

  • Don’t use the React SDK, use just the plain Fingerprint Pro NPM package or our lower-level SPA library and call it on a client wherever you want OR
  • Take data from React SDK's useVisitorData and stuff them wherever you want (window object, some global variable, localStorage, etc...) in a useEffect and pick them up from there when you need to.