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
<ahref="https://www.npmjs.com/package/@fingerprintjs/fingerprintjs-pro-react"><imgsrc="https://img.shields.io/npm/dm/@fingerprintjs/fingerprintjs-pro-react.svg"alt="Monthly downloads from NPM"></a>
<ahref="https://www.npmjs.com/package/@fingerprint/react"><imgsrc="https://img.shields.io/npm/dm/@fingerprint/react.svg"alt="Monthly downloads from NPM"></a>
Fingerprint is a device intelligence platform offering industry-leading accuracy. Fingerprint Pro React SDK is an easy way to integrate **[Fingerprint Pro](https://fingerprint.com/)** into your React application. It's also compatible with Next.js and Preact. See application demos in the [examples](https://github.com/fingerprintjs/fingerprintjs-pro-react/tree/main/examples) folder.
22
+
Fingerprint is a device intelligence platform offering industry-leading accuracy. Fingerprint React SDK is an easy way to integrate **[Fingerprint](https://fingerprint.com/)** into your React application. It's also compatible with Next.js and Preact. See application demos in the [examples](https://github.com/fingerprintjs/react/tree/main/examples) folder.
23
23
24
24
## Table of contents
25
25
26
26
27
-
-[Fingerprint Pro React](#fingerprint-pro-react)
27
+
-[Fingerprint React](#fingerprint-react)
28
28
-[Table of contents](#table-of-contents)
29
29
-[Requirements](#requirements)
30
30
-[Installation](#installation)
31
31
-[Getting started](#getting-started)
32
-
-[1. Wrap your application (or component) in `<FpjsProvider>`.](#1-wrap-your-application-or-component-in-fpjsprovider)
32
+
-[1. Wrap your application (or component) in `<FingerprintProvider>`.](#1-wrap-your-application-or-component-in-FingerprintProvider)
33
33
-[2. Use the `useVisitorData()` hook in your components to identify visitors](#2-use-the-usevisitordata-hook-in-your-components-to-identify-visitors)
34
34
-[Linking and tagging information](#linking-and-tagging-information)
35
35
-[Caching strategy](#caching-strategy)
@@ -46,69 +46,59 @@ Fingerprint is a device intelligence platform offering industry-leading accuracy
46
46
- For Typescript users: Typescript 4.8 or higher
47
47
48
48
> [!NOTE]
49
-
> This package assumes you have a Fingerprint Pro subscription or trial, it is not compatible with the [source-available FingerprintJS](https://github.com/fingerprintjs/fingerprintjs). See our documentation to learn more about the [differences between Fingerprint Pro and FingerprintJS](https://dev.fingerprint.com/docs/identification-vs-fingerprintjs).
49
+
> This package assumes you have a Fingerprint subscription or trial, it is not compatible with the [source-available FingerprintJS](https://github.com/fingerprintjs/fingerprintjs). See our documentation to learn more about the [differences between Fingerprint and FingerprintJS](https://docs.fingerprint.com/docs/identification-vs-fingerprintjs).
In order to identify visitors, you'll need a Fingerprint Pro account (you can [sign up for free](https://dashboard.fingerprint.com/signup/)).
74
-
To get your API key and get started, see the [Fingerprint Pro Quick Start Guide](https://dev.fingerprint.com/docs/quick-start-guide).
73
+
In order to identify visitors, you'll need a Fingerprint account (you can [sign up for free](https://dashboard.fingerprint.com/signup/)).
74
+
To get your API key and get started, see the [Fingerprint Quick Start Guide](https://docs.fingerprint.com/docs/quick-start-guide).
75
75
76
-
### 1. Wrap your application (or component) in `<FpjsProvider>`.
76
+
### 1. Wrap your application (or component) in `<FingerprintProvider>`.
77
77
78
78
- Set `apiKey` to your Fingerprint [Public API Key](https://dashboard.fingerprint.com/api-keys).
79
-
- Set `region` if you have chosen a non-global [region](https://dev.fingerprint.com/docs/regions) during registration.
80
-
- Set `endpoint`and `scriptUrlPattern`if you are using [one of our proxy integrations to increase accuracy](https://dev.fingerprint.com/docs/protecting-the-javascript-agent-from-adblockers) and effectiveness of visitor identification.
81
-
- You can use all the [load options](https://dev.fingerprint.com/reference/load-function#load-options) available in the JavaScript agent `load` function.
79
+
- Set `region` if you have chosen a non-global [region](https://docs.fingerprint.com/docs/regions) during registration.
80
+
- Set `endpoint` if you are using [one of our proxy integrations to increase accuracy](https://docs.fingerprint.com/docs/protecting-the-javascript-agent-from-adblockers) and effectiveness of visitor identification.
81
+
- You can use all the [start options](https://docs.fingerprint.com/reference/js-agent-v4-start-function#start-options) available in the JavaScript agent `load` function.
The `useVisitorData` hook also returns a `getData` method you can use to make an API call on command.
148
133
149
-
- You can pass `{ ignoreCache: true }` to `useVisitorData` to force a fresh identification request.
150
134
- You can pass `{ immediate: false }` to `useVisitorData` to disable automatic visitor identification on render.
151
135
152
-
Both `useVisitorData` and `getData` accept all the [get options](https://dev.fingerprint.com/reference/get-function#get-options) available in the JavaScript agent `get` function.
136
+
Both `useVisitorData` and `getData` accept all the [get options](https://docs.fingerprint.com/reference/get-function#get-options) available in the JavaScript agent `get` function.
The `visitorId` provided by Fingerprint Identification is especially useful when combined with information you already know about your users, for example, account IDs, order IDs, etc. To learn more about various applications of the `linkedId` and `tag`, see [Linking and tagging information](https://dev.fingerprint.com/docs/tagging-information).
192
+
The `visitorId` provided by Fingerprint Identification is especially useful when combined with information you already know about your users, for example, account IDs, order IDs, etc. To learn more about various applications of the `linkedId` and `tag`, see [Linking and tagging information](https://docs.fingerprint.com/docs/tagging-information).
210
193
211
194
Associate the visitor ID with your data using the `linkedId` or `tag` parameter of the options object passed into the `useVisitorData()` hook or the `getData` function:
212
195
@@ -224,32 +207,18 @@ function App() {
224
207
// ...
225
208
```
226
209
227
-
## Caching strategy
228
-
229
-
Fingerprint Pro usage is billed per API call. To avoid unnecessary API calls, it is a good practice to cache identification results. By default, the SDK uses `sessionStorage` to cache results.
230
-
231
-
- Specify the `cacheLocation` prop on `<FpjsProvider>` to instead store results in `memory` or `localStorage`. Use `none` to disable caching completely.
232
-
- Specify the `cacheTimeInSeconds` prop on `<FpjsProvider>` to set the cache time in seconds. It cannot exceed 86400 seconds (24 hours).
233
-
- Specify the `cache` prop on `<FpjsProvider>` to use your custom cache implementation instead. For more details, see [Creating a custom cache](https://github.com/fingerprintjs/fingerprintjs-pro-spa#creating-a-custom-cache)
234
-
in the Fingerprint Pro SPA repository (a lower-level Fingerprint library used by this SDK).
235
-
- Pass `{ignoreCache: true}` to the `getData()` function to ignore cached results for that specific API call.
236
-
237
-
> [!NOTE]
238
-
> If you use data from [`extendedResult`](https://dev.fingerprint.com/reference/get-function#extendedresult), pay additional attention to your caching strategy.
239
-
> Some fields, for example, `ip` or `lastSeenAt`, might change over time for the same visitor. Use `getData({ ignoreCache: true })` to fetch the latest identification results.
240
-
241
210
## Error handling
242
211
243
-
The `getData` function throws errors directly from the JS Agent without changing them. See [JS Agent error handling](https://dev.fingerprint.com/reference/error-handling) for more details.
212
+
The `getData` function throws errors directly from the JS Agent without changing them. See [JS Agent error handling](https://docs.fingerprint.com/reference/js-agent-v4-error-handling) for more details.
244
213
245
214
## API Reference
246
215
247
-
See the full [generated API reference](https://fingerprintjs.github.io/fingerprintjs-pro-react/).
216
+
See the full [generated API reference](https://fingerprintjs.github.io/react/).
248
217
249
218
## Support and feedback
250
219
251
-
To ask questions or provide feedback, use [Issues](https://github.com/fingerprintjs/fingerprintjs-pro-react/issues). If you need private support, please email us at `oss-support@fingerprint.com`. If you'd like to have a similar React wrapper for the [source-availalbe FingerprintJS](https://github.com/fingerprintjs/fingerprintjs), consider creating an issue in the main [FingerprintJS repository](https://github.com/fingerprintjs/fingerprintjs/issues).
220
+
To ask questions or provide feedback, use [Issues](https://github.com/fingerprintjs/react/issues). If you need private support, please email us at `oss-support@fingerprint.com`. If you'd like to have a similar React wrapper for the [source-availalbe FingerprintJS](https://github.com/fingerprintjs/fingerprintjs), consider creating an issue in the main [FingerprintJS repository](https://github.com/fingerprintjs/fingerprintjs/issues).
252
221
253
222
## License
254
223
255
-
This project is licensed under the MIT license. See the [LICENSE](https://github.com/fingerprintjs/fingerprintjs-pro-react/blob/main/LICENSE) file for more info.
224
+
This project is licensed under the MIT license. See the [LICENSE](https://github.com/fingerprintjs/react/blob/main/LICENSE) file for more info.
0 commit comments