Upgrading from SDK v3? See the migration guide for a full list of breaking changes, including the package rename from
@fingerprintjs/fingerprintjs-pro-react-native to @fingerprint/react-native.Requirements
The React Native SDK uses the Android and iOS SDKs under the hood, and it requires React Native 0.80, so the effective minimum versions are:- React Native 0.80 or higher, with the New Architecture enabled. The Old Architecture isn’t supported. This floor comes from the SDK’s use of React Native’s Strict TypeScript API.
- Android 7.0 (API level 24+) or higher, as required by React Native 0.80
- iOS 15.1 or higher (or tvOS 15 or higher), Swift 5.9 or higher
- Expo SDK 54 or higher. The SDK isn’t usable in Expo Go because it includes custom native code; use a development build instead.
How to install
1. Install the package using your favorite package manager:
2. Configure dependencies:
Expo setup
- Add the config plugin to your
app.jsonorapp.config.js:
app.json
- Rebuild your native projects:
Because the SDK includes custom native code, it doesn’t work in Expo Go. Use
npx expo run:ios/run:android or an EAS development build.Bare React Native setup
- Configure iOS dependencies (if developing on iOS)
- Configure Android dependencies (if developing on Android)
dependencyResolutionManagement block in {rootDir}/android/settings.gradle. Add the Maven repositories in this block:
Groovy
3. SPM support (experimental)
On React Native 0.87 and higher, you can link iOS dependencies with Swift Package Manager instead of CocoaPods:pod install.
Web support
If your app also targets web (for example with React Native Web), install@fingerprint/agent as an optional peer dependency:
Usage
Configure the SDK by wrapping your application inFingerprintProvider.
JavaScript
useVisitorData hook in your components to perform visitor identification and get the data. getData always throws on error, and immediate defaults to false so the SDK doesn’t fetch eagerly on mount (native platforms don’t cache results, so eager fetches cost API calls).
JavaScript
API client
To integrate outside of a React component, callstart() once to create a client. start() returns the client synchronously; only get() is asynchronous.
JavaScript
useFingerprint
UseuseFingerprint() inside FingerprintProvider to read the same client from context, for example to call get() from an event handler instead of relying on the hook’s automatic fetch:
JavaScript
Response format
useVisitorData and get() resolve with a flat object that matches the Server API v4 event format:
extendedResponseFormat or the nested extended fields (ipLocation, firstSeenAt, osName, and similar); it always returns this flat format. Use IP Geolocation and the other Smart Signals for the data those fields used to carry.
Error handling
All identification failures are instances ofFingerprintError, with name, code, and event_id fields. Use the isFingerprintError type guard to identify them, and discriminate behavior on error.code:
JavaScript
code is a string union that groups into:
- Server / API v4 error codes, returned by the Fingerprint API itself
- Native client-side error codes, raised by the underlying Android or iOS SDK
- Web client-side error codes, raised by the underlying
@fingerprint/agentclient
code as open to unknown strings; handle the codes you care about and fall back to generic handling for the rest.
Linking and tagging
Passtags, linkedId, and timeout together as a single options object:
JavaScript
Proximity detection
Location-based options are grouped by platform:JavaScript
Caching
Caching is web-only and disabled by default. Enable it via theweb option:
JavaScript
Documentation
You can find the full documentation in the official GitHub repository.Limitations
- Fingerprint request filtering is not supported right now. Allowed and forbidden origins cannot be used.