Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@fingerprintjs/fingerprintjs-pro-react-native

fingerprintjs20.4kMIT3.4.0TypeScript support: included

Official React Native client for Fingerprint. Best identification solution for React Native.

fraud, fraud detection, fraud prevention, browser, identification, fingerprint, fingerprinting, browser fingerprint, device fingerprint, privacy

readme

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://fingerprintjs.github.io/home/resources/logo_light.svg" /> <source media="(prefers-color-scheme: light)" srcset="https://fingerprintjs.github.io/home/resources/logo_dark.svg" /> Fingerprint logo </picture>

coverage Current NPM version Monthly downloads from NPM Discord server Discord server

Fingerprint Pro React Native

Fingerprint is a device intelligence platform offering industry-leading accuracy. Fingerprint Pro React Native SDK is an easy way to integrate Fingerprint Pro into your React Native application to call the native Fingerprint Pro libraries (Android and iOS) and identify devices.

Table of contents

Requirements and limitations

  • React Native versions 0.73 through 0.79 are supported
  • Android 5.0 (API level 21+) or higher
  • iOS 13+/tvOS 15+, Swift 5.7 or higher (stable releases)

  • Fingerprint Pro request filtering is not supported right now. Allowed and forbidden origins cannot be used.

  • Usage inside the Expo environment is not supported right now.

Dependencies

How to install

1. Install the package using your favorite package manager:

  • NPM:

    npm install @fingerprintjs/fingerprintjs-pro-react-native --save
  • Yarn:

    yarn add @fingerprintjs/fingerprintjs-pro-react-native
  • PNPM:

    pnpm add @fingerprintjs/fingerprintjs-pro-react-native

2. Configure iOS dependencies (if developing on iOS)

cd ios && pod install

3. 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:

Gradle 7 or newer

For Gradle 7.0 and higher (if you've adopted the new Gradle settings file approach), you likely manage repositories in the dependencyResolutionManagement block in {rootDir}/android/settings.gradle. Add the Maven repositories in this block:

dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
  repositories {
    google()
    mavenCentral()
    maven {
      url("https://maven.fpregistry.io/releases") // Add this
    }
  }
}

Gradle 6.0 or older

For Gradle versions before 7.0, you likely have an allprojects block in {rootDir}/android/build.gradle. Add the Maven repositories within this block:

allprojects {
    repositories {
      mavenCentral()
      mavenLocal()
      maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url("$rootDir/../node_modules/react-native/android")
      }
      maven {
        // Android JSC is installed from npm
        url("$rootDir/../node_modules/jsc-android/dist")
      }
      maven {
        url("https://maven.fpregistry.io/releases") // Add this
      }
      google()
    }
}

Usage

To identify visitors, you need a Fingerprint Pro account (you can sign up for free).

Hooks approach

Configure the SDK by wrapping your application in FingerprintJsProProvider.

// src/index.js
import React from 'react';
import { AppRegistry } from 'react-native';
import { FingerprintJsProProvider } from '@fingerprintjs/fingerprintjs-pro-react-native';
import App from './App';
import { name as appName } from './app.json';

const WrappedApp = () => (
  <FingerprintJsProProvider apiKey={'your-fpjs-public-api-key'} region={'eu'}>
    <App />
  </FingerprintJsProProvider>
)

AppRegistry.registerComponent(appName, () => WrappedApp);

Use the useVisitorData hook in your components to perform visitor identification and get the data.

// src/App.js
import React from 'react'
import {Button, SafeAreaView, Text, View} from 'react-native'
import {useVisitorData} from '@fingerprintjs/fingerprintjs-pro-react-native'

export default function App() {
  const {isLoading, error, data, getData} = useVisitorData()

  return (
    <SafeAreaView>
      <View style={{ margin: 8 }}>
        <Button title='Reload data' onPress={() => getData()} />
        {isLoading ? (
          <Text>Loading...</Text>
        ) : (
          <>
            <Text>VisitorId: {data?.visitorId}</Text>
            <Text>Full visitor data:</Text>
            <Text>{error ? error.message : JSON.stringify(data, null, 2)}</Text>
          </>
        )}
      </View>
    </SafeAreaView>
  )
}

API Client approach

import React, { useEffect } from 'react';
import { FingerprintJsProAgent } from '@fingerprintjs/fingerprintjs-pro-react-native';

// ... 

useEffect(() => {
  async function getVisitorInfo() {
    try {
      const FingerprintClient = new FingerprintJsProAgent({ apiKey: 'PUBLIC_API_KEY', region: 'eu' }); // Region may be 'us', 'eu', or 'ap'
      const visitorId = await FingerprintClient.getVisitorId(); // Use this method if you need only visitorId
      const visitorData = await FingerprintClient.getVisitorData(); // Use this method if you need additional information about visitor
      // use visitor data in your code
    } catch (e) {
      console.error('Error: ', e);
    }
  }
  getVisitorInfo();
}, []);

extendedResponseFormat

Two types of responses are supported: "default" and "extended". You don't need to pass any parameters to get the "default" response. "Extended" is an extended result format that includes geolocation, incognito mode and other information. It can be requested using the extendedResponseFormat: true parameter. See more details about the responses in the documentation.

Providing extendedResponseFormat using hooks:

return (
  <FingerprintJsProProvider apiKey={PUBLIC_API_KEY} extendedResponseFormat={true}>
    <App />
  </FingerprintJsProProvider>
)

Providing extendedResponseFormat using the API Client:

const FingerprintClient = new FingerprintJsProAgent({
  apiKey: 'PUBLIC_API_KEY',
  region: 'eu',
  extendedResponseFormat: true,
})

Linking and tagging information

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.

const tag = {
  userAction: 'login',
  analyticsId: 'UA-5555-1111-1'
};
const linkedId = 'user_1234';

// Using hooks
const { getData } = useVisitorData();
const visitorData = await getData(tag, linkedId);

// Using the client
const FingerprintClient = new FingerprintJsProAgent({ apiKey: 'PUBLIC_API_KEY'});
const visitorId = await FingerprintClient.getVisitorId(tag, linkedId);
const visitor = await FingerprintClient.getVisitorData(tag, linkedId); 

API Reference

See the full generated API Reference.

Additional Resources

Support and feedback

To report problems, ask questions or provide feedback, please use Issues. If you need private support, please email us at `oss-support@fingerprint.com`.

License

This project is licensed under the MIT license.

changelog

3.4.0 (2025-05-12)

Features

  • android: set minSdkVersion to 24 (78a96d9)

Bug Fixes

  • don't convert boolean fields of tag to int for iOS platform (82c91a8)
  • ios: revert podspec to dsl format (38fc9ae)

Documentation

  • README: mention support for react-native version up to 0.79 (a783162)
  • README: update package description (62d3f91)

Supported Native SDK Version Range

  • Fingerprint Android SDK Version Range: >= 2.7.0 and < 3.0.0
  • Fingerprint iOS SDK Version Range: >= 2.7.0 and < 3.0.0

3.3.1 (2025-01-30)

Bug Fixes

  • fix compatibility with React Native new architecture (v0.76+) (8b2003b)
  • improve Android types to make project Kotlin v2 compatible (RN 0.77+) (891c9c3)

3.3.0 (2025-01-09)

Features

  • add custom timeout feature (02757ef)
  • add sealed result support (37dbe7f)
  • update iOS and Android SDKs to v2.7.0 (eafa1d4)

3.2.0 (2024-10-08)

Features

  • use Fingerprint Pro Android v2.6.0 (8d5c417)

3.1.0 (2024-08-22)

Features

  • add fallbackEndpointUrls configuration param (5ce1864)
  • update Android agent to v2.5.0 (6dfcb88)
  • update iOS agent to v2.6.0 (dfe83b2)

Documentation

  • README: unify and simplify linkedId section (67cb56e)

3.0.2 (2024-03-28)

Build System

  • deps: bump ip from 1.1.8 to 1.1.9 (cb27362)

3.0.1 (2024-03-20)

Bug Fixes

  • publish package with correct version in integration info (a561071)

3.0.0 (2024-01-22)

⚠ BREAKING CHANGES

  • migrated to Gradle 8
  • minimum supported React Native version is 0.73

Features

Documentation

  • update requirements section (8229a3c)

2.6.0 (2023-11-28)

Features

  • update iOS agent to 2.3.1 (6b6f8cf)

Documentation

  • update requirements section (ae5e74f)

2.5.3 (2023-10-17)

Documentation

  • add support and feedback section, merge limitations with requirements (46ba804)
  • add requirements section, revisit README.md (c298393)
  • add table of contents (c95748d)

2.5.2 (2023-09-20)

Bug Fixes

  • fix package publishing problems (cb51a80)
  • use dist folder instead of build for build artifacts to unify dx with other projects (be9b5ca)

2.5.1 (2023-09-07)

Documentation

  • README: add minumum OS versions requirement (c734fc9)

2.5.0 (2023-08-07)

Features

  • update Android agent to v2.3.2 (fb5f655)

2.4.0 (2023-06-29)

Features

  • bump iOS Agent to v2.2.0 to introduce new Smart Signals (e47613b)

2.3.1 (2023-06-27)

Bug Fixes

  • mark library as not required in MainQueue #79 (e544d7e)

2.3.0 (2023-04-28)

Features

  • bump android dependencies (862b327)

2.2.2 (2023-03-22)

Bug Fixes

  • update Android agent to 2.3.0 (de724a1)

2.2.1 (2023-03-14)

Documentation

  • code snippet fix for FingerprintJsProProvider (4249f53)
  • readme fix code snippets (6a11ef3)

2.2.0 (2023-02-17)

Features

  • update agents to add proxy integrations support (51a6b45)

Bug Fixes

  • update Android agent to 2.2.3 to fix Cloudflare support (cbfd260)
  • update iOS agent to 2.1.8 to fix fingerprintjs/fingerprintjs-pro-ios#27 (f7929b3)

2.1.1 (2023-01-11)

Bug Fixes

  • remove redundant gradle dependency from library (d7439d2)

2.1.0 (2022-11-18)

Features

  • update android agent to 2.2.0 version (212f601)

2.0.0 (2022-09-27)

⚠ BREAKING CHANGES

  • In previous version FingerprintJsProAgent constructor had several position arguments. In new version it is one params argument of type FingerprintJsProAgentParams. Type FingerprintJsProAgentParams will be used instead of type FingerprintJsProProviderOptions.
  • getData method of the useVisitorData hook now returns answer of type VisitorData instead of simple visitorId string type.

Features

  • add extendedResponseFormat configuration flag (2add6cc)
  • add getVisitorData method to the react-native agent (16b4378)
  • better error reporting (f011cb7)
  • change FingerprintJsProAgent constructor interface (1b8aab9)
  • send integration info (f52e2cf)
  • support linkedId param for identification requests (e8557db)
  • update android agent to the latest version (4051a7b)
  • update iOS agent to 2.1.3 (14a0e42)
  • update iOS agent to the latest version (a33d160)
  • update iOS agent to v2.1.1 (f4541f2)
  • update iOS native agent to 2.1.2 to return support of iOS 12 (20c7342)
  • update react-native to 0.70.1 (22b8d33)

Bug Fixes

  • async code example (e0bd804)
  • change substitution literal in .husky/commit_msg (2267a30)
  • error description (c82c45b)
  • expand Tags type (08e6a73)
  • generate iOS Metadata even if linkedId is nil (858ac51)
  • getVisitorId error handling (c2971cd)
  • pass correct linkedId type to the android library (68fa2e4)
  • tag functionality for new iOS library (be590e6)

Documentation

  • README: add documentation badge (62a3df1)

1.0.4 (2022-08-05)

Bug Fixes
  • add types field to package.json (42ccce56)

1.0.3 (2022-07-25)

Chores
  • add production environment for publish task (94309b78)
Documentation Changes
  • replace fingerptintjs.com domain in links to fingerprint.com (bd14519d)
  • update logo (0f06f85e)
Bug Fixes
  • readme (71b47abe)

1.0.2 (2022-05-13)

Documentation Changes
  • second attempt to fix logo for npmjs.com (4daf6fb3)

1.0.1 (2022-05-13)

Documentation Changes
  • fix fingerprint logo for npmjs.com (c59e820a)

1.0.0 (2022-05-12)

Breaking changes
Chores
  • add changelog generation and release commands (77967653)
  • add publish action (e8332a73)
  • fix npm package files section (63fb5641)
  • change iOS codeowner (77f8f3d5)
  • add iOS and Android folder to sync script (8f2ab4c1)
  • update build environment (d73ad61b)
  • add linter, run prettier (bcf9bbcf)
  • change author in podspec to FingerprintJS Inc (ec63bfcd)
  • add github action for tests and typecheck (051ebb40)
  • add CODEOWNERS (25a610ab)
  • fix typecheck (abd940a6)
  • use rollup build (0c1d7476)
  • fixed iOS build (2f2a7694)
  • make agent compatible with mocks (285a7351)
  • deps:
    • bump vulnerable simple-plist from 1.3.0 to 1.3.1 (f35317a8)
    • bump ansi-regex from 4.1.0 to 4.1.1 (584b8a60)
    • bump minimist from 1.2.5 to 1.2.6 (bd02e14f)
    • bump plist from 3.0.4 to 3.0.5 (b35d3b90)
    • bump plist from 3.0.4 to 3.0.5 in /TestProject (a9e6b776)
    • bump async from 2.6.3 to 2.6.4 (7caf632b)
    • bump minimist from 1.2.5 to 1.2.6 in /TestProject (2abc2347)
    • bump async from 2.6.3 to 2.6.4 in /TestProject (97212225)
    • bump ansi-regex from 4.1.0 to 4.1.1 in /TestProject (a465ae5a)
Documentation Changes
  • add jsdoc to code, fix readme example (4a9e9490)
  • add iOS contributing instruction (03c7da7b)
  • add contributing.md (1afb9460)
  • add new badges, fix existing (2e89589b)
  • improve usage snippet (1f3b411e)
New Features
  • support ap region (dcf7fd23)
  • add dotenv support to TestApp, use public API key from env. (470701b7)
  • add hooks approach #10, fix dev build (1a8976d1)
  • add tags property to getVisitorData function (a78772f0)
Bug Fixes
  • fix endpoint param in iOS #14 (82dc9629)
Tests
  • add tests for provider and useVisitorData hook (fee4d8af)