Skip to main content
Fingerprint React Native is an official open-source library for projects written in React Native for iOS and Android platforms. This library allows developers to use Fingerprint capabilities in the React Native context. View our React Native quickstart for a step-by-step guide to get started.
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

  1. Add the config plugin to your app.json or app.config.js:
app.json
  1. 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

  1. Configure iOS dependencies (if developing on iOS)
  1. Configure Android dependencies (if developing on Android)
Add the repositories to your Gradle configuration file. The location for these additions depends on your project’s structure and the Gradle version you’re using: You likely manage repositories in the 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:
SPM support is experimental. If you hit issues, fall back to 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 in FingerprintProvider.
JavaScript
Use the 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, call start() once to create a client. start() returns the client synchronously; only get() is asynchronous.
JavaScript

useFingerprint

Use useFingerprint() 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:
The SDK no longer supports 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 of FingerprintError, 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/agent client
Treat code as open to unknown strings; handle the codes you care about and fall back to generic handling for the rest.

Linking and tagging

Pass tags, 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 the web 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.