Releases: fingerprintjs/react-native
Release list
@fingerprint/react-native@4.0.0
Major Changes
-
Dropped React Native Old Architecture support. The native module is now a TurboModule (New Architecture only) exposed via a Codegen spec.
Migrated the project to Strict TypeScript API.
This is a breaking change: the SDK now requires React Native >= 0.80 (Expo SDK >= 54) with the New Architecture enabled. (e83c165)
-
Migrated the SDK to Fingerprint API v4 and realigned the public API with
@fingerprint/react. This is a breaking change on every platform (web, iOS, Android).Renamed API
FingerprintJsProProvider→FingerprintProvider.FingerprintJsProAgent(constructed withnew) →start(options), returning a client with a singleget(options)method (getVisitorId/getVisitorDataare removed).- Added
useFingerprint()to read the client from context.
Single options object
getData(tags, linkedId, options)→getData({ tags, linkedId, timeout }).useVisitorDatanow returns a discriminated union (data/isLoading/isFetched/error), andgetDataalways throws on error. ThethrowOnErroroption is removed.immediatedefaults tofalse.
Grouped provider/start options
- Platform-only options are nested:
android(allowUseOfLocationData,locationTimeoutMillis),ios(allowUseOfLocationData),web(storageKeyPrefix,urlHashing,cache).locationTimeoutMillisAndroidmoves toandroid.locationTimeoutMillis. endpointUrl+fallbackEndpointUrlsare replaced by a singleendpoints(string or string[]).
snake_case response
- The response is now the flat, snake_case
FingerprintResponse(visitor_id,event_id,suspect_score?,sealed_result), matching the Server API v4 and JS agent.requestIdis replaced byevent_id,confidenceis removed, andsuspect_scoreis a new optional Smart Signals value;sealedResultis renamed tosealed_result. The nested extended fields (ipLocation,firstSeenAt, etc.) and theextendedResponseFormatoption are removed (v4 always returns the flat format).
Single error type
- The ~28 error classes are replaced by a single
FingerprintError({ name, code, event_id }) plus anisFingerprintErrortype guard. Discriminate onerror.code(e.g.too_many_requests). - Every network failure reports
code: 'network_error'on all platforms. The platform-specificnetwork_unavailable(Android),network_connectionandnetwork_abort(web) codes are not emitted.
Web
- The web implementation now uses
@fingerprint/agent(v4) instead of@fingerprintjs/fingerprintjs-pro-spa. Install@fingerprint/agentas the web peer dependency. - ️Caching is available only on web and is disabled by default. To enable caching on web, pass the JavaScript agent cache option:
<FingerprintProvider apiKey={'your-fpjs-public-api-key'} region={'eu'} web={{cache: {storage: 'sessionStorage', duration: 'optimize-cost'}}} > <App /> </FingerprintProvider>
iOS:
- The new version floor for iOS is 15.1.
Android:
- The new version floor for Android is Android 7.0 (API level 24+).
Migration
Provider
- import { FingerprintJsProProvider } from '@fingerprint/react-native' + import { FingerprintProvider } from '@fingerprint/react-native' - <FingerprintJsProProvider apiKey="PUBLIC_API_KEY" region="eu"> + <FingerprintProvider apiKey="PUBLIC_API_KEY" region="eu"> <App /> - </FingerprintJsProProvider> + </FingerprintProvider>
Hook (
useVisitorData)- const { isLoading, error, data, getData } = useVisitorData() + const { isLoading, isFetched, error, data, getData } = useVisitorData() // positional args + opt-in throwing → single options object, always throws - await getData({ userAction: 'login' }, 'user_1234', { timeout: 5000, throwOnError: true }) + await getData({ tags: { userAction: 'login' }, linkedId: 'user_1234', timeout: 5000 }) - data?.visitorId - data?.confidence.score + data?.visitor_id + data?.suspect_score
Imperative client
- import { FingerprintJsProAgent } from '@fingerprint/react-native' + import { start } from '@fingerprint/react-native' - const client = new FingerprintJsProAgent({ apiKey: 'PUBLIC_API_KEY', region: 'eu' }) - const visitorId = await client.getVisitorId() - const data = await client.getVisitorData() + const fp = start({ apiKey: 'PUBLIC_API_KEY', region: 'eu' }) + const result = await fp.get() + result.visitor_id
Provider / start options
{ apiKey: 'PUBLIC_API_KEY', region: 'eu', - endpointUrl: 'https://metrics.example.com', - fallbackEndpointUrls: ['https://metrics2.example.com'], + endpoints: ['https://metrics.example.com', 'https://metrics2.example.com'], - extendedResponseFormat: true, - allowUseOfLocationData: true, - locationTimeoutMillisAndroid: 5000, + android: { allowUseOfLocationData: true, locationTimeoutMillis: 5000 }, + ios: { allowUseOfLocationData: true }, }Errors
- import { TooManyRequestError } from '@fingerprint/react-native' + import { isFingerprintError } from '@fingerprint/react-native' try { await fp.get() } catch (error) { - if (error instanceof TooManyRequestError) { + if (isFingerprintError(error) && error.code === 'too_many_requests') { // handle rate limiting } }
Web peer dependency
- npm install @fingerprintjs/fingerprintjs-pro-spa + npm install @fingerprint/agent
--- (64f1dfb)
Minor Changes
-
Added experimental support for Swift Package Manager. The library now ships with its own
Package.swift.If you are on React Native >= 0.87, you can run:
cd ios # deintegrate will remove CocoaPods from your project npx react-native spm --deintegrate
to consume the library via Swift Package Manager. (7af274f)
Patch Changes
- Fixed
tagsvalidation to reject circular references with a clearTypeErrorinstead of throwing an unhandledRangeError: Maximum call stack size exceeded. (f102cf0)
Supported Native SDK Version Range
- Fingerprint iOS SDK Version Range:
~> 4.1.0 - Fingerprint Android SDK Version Range:
>= 4.1.0 and < 4.2.0
@fingerprint/react-native@4.0.0-rc.1
Major Changes
-
Migrated the SDK to Fingerprint API v4 and realigned the public API with
@fingerprint/react. This is a breaking change on every platform (web, iOS, Android).Renamed API
FingerprintJsProProvider→FingerprintProvider.FingerprintJsProAgent(constructed withnew) →start(options), returning a client with a singleget(options)method (getVisitorId/getVisitorDataare removed).- Added
useFingerprint()to read the client from context.
Single options object
getData(tags, linkedId, options)→getData({ tags, linkedId, timeout }).useVisitorDatanow returns a discriminated union (data/isLoading/isFetched/error), andgetDataalways throws on error. ThethrowOnErroroption is removed.immediatedefaults tofalse.
Grouped provider/start options
- Platform-only options are nested:
android(allowUseOfLocationData,locationTimeoutMillis),ios(allowUseOfLocationData),web(storageKeyPrefix,urlHashing,cache).locationTimeoutMillisAndroidmoves toandroid.locationTimeoutMillis. endpointUrl+fallbackEndpointUrlsare replaced by a singleendpoints(string or string[]).
snake_case response
- The response is now the flat, snake_case
FingerprintResponse(visitor_id,event_id,suspect_score?,sealed_result), matching the Server API v4 and JS agent.requestIdis replaced byevent_id,confidenceis removed, andsuspect_scoreis a new optional Smart Signals value;sealedResultis renamed tosealed_result. The nested extended fields (ipLocation,firstSeenAt, etc.) and theextendedResponseFormatoption are removed (v4 always returns the flat format).
Single error type
- The ~28 error classes are replaced by a single
FingerprintError({ name, code, event_id }) plus anisFingerprintErrortype guard. Discriminate onerror.code(e.g.too_many_requests). - Every network failure reports
code: 'network_error'on all platforms. The platform-specificnetwork_unavailable(Android),network_connectionandnetwork_abort(web) codes are not emitted.
Web
- The web implementation now uses
@fingerprint/agent(v4) instead of@fingerprintjs/fingerprintjs-pro-spa. Install@fingerprint/agentas the web peer dependency. - ️Caching is available only on web and is disabled by default. To enable caching on web, pass the JavaScript agent cache option:
<FingerprintProvider apiKey={'your-fpjs-public-api-key'} region={'eu'} web={{cache: {storage: 'sessionStorage', duration: 'optimize-cost'}}} > <App /> </FingerprintProvider>
iOS:
- The new version floor for iOS is 15.1.
Android:
- The new version floor for Android is Android 7.0 (API level 24+).
Migration
Provider
- import { FingerprintJsProProvider } from '@fingerprint/react-native' + import { FingerprintProvider } from '@fingerprint/react-native' - <FingerprintJsProProvider apiKey="PUBLIC_API_KEY" region="eu"> + <FingerprintProvider apiKey="PUBLIC_API_KEY" region="eu"> <App /> - </FingerprintJsProProvider> + </FingerprintProvider>
Hook (
useVisitorData)- const { isLoading, error, data, getData } = useVisitorData() + const { isLoading, isFetched, error, data, getData } = useVisitorData() // positional args + opt-in throwing → single options object, always throws - await getData({ userAction: 'login' }, 'user_1234', { timeout: 5000, throwOnError: true }) + await getData({ tags: { userAction: 'login' }, linkedId: 'user_1234', timeout: 5000 }) - data?.visitorId - data?.confidence.score + data?.visitor_id + data?.suspect_score
Imperative client
- import { FingerprintJsProAgent } from '@fingerprint/react-native' + import { start } from '@fingerprint/react-native' - const client = new FingerprintJsProAgent({ apiKey: 'PUBLIC_API_KEY', region: 'eu' }) - const visitorId = await client.getVisitorId() - const data = await client.getVisitorData() + const fp = start({ apiKey: 'PUBLIC_API_KEY', region: 'eu' }) + const result = await fp.get() + result.visitor_id
Provider / start options
{ apiKey: 'PUBLIC_API_KEY', region: 'eu', - endpointUrl: 'https://metrics.example.com', - fallbackEndpointUrls: ['https://metrics2.example.com'], + endpoints: ['https://metrics.example.com', 'https://metrics2.example.com'], - extendedResponseFormat: true, - allowUseOfLocationData: true, - locationTimeoutMillisAndroid: 5000, + android: { allowUseOfLocationData: true, locationTimeoutMillis: 5000 }, + ios: { allowUseOfLocationData: true }, }Errors
- import { TooManyRequestError } from '@fingerprint/react-native' + import { isFingerprintError } from '@fingerprint/react-native' try { await fp.get() } catch (error) { - if (error instanceof TooManyRequestError) { + if (isFingerprintError(error) && error.code === 'too_many_requests') { // handle rate limiting } }
Web peer dependency
- npm install @fingerprintjs/fingerprintjs-pro-spa + npm install @fingerprint/agent
--- (64f1dfb)
Minor Changes
-
Added experimental support for Swift Package Manager. The library now ships with its own
Package.swift.If you are on React Native >= 0.87, you can run:
cd ios # deintegrate will remove CocoaPods from your project npx react-native spm --deintegrate
to consume the library via Swift Package Manager. (7af274f)
@fingerprintjs/fingerprintjs-pro-react-native@4.0.0-rc.0
Major Changes
-
Dropped React Native Old Architecture support. The native module is now a TurboModule (New Architecture only) exposed via a Codegen spec.
This is a breaking change: the SDK now requires React Native >= 0.79 (Expo SDK >= 53) with the New Architecture enabled. (e83c165)
@fingerprintjs/fingerprintjs-pro-react-native@3.17.1
Patch Changes
- Fix logic in
FingerprintJsProProviderthat prevented the agent from being updated after its parameters changed (01d5667)
@fingerprintjs/fingerprintjs-pro-react-native@3.17.0
Minor Changes
- Add an option to rethrow errors from
useVisitorData().getData. (86230b3)
Example usage:
const { isLoading, error, data, getData } = useVisitorData()
try {
const visitorData = await getData(tags, linkedId, { throwOnError: true })
// visitorData is VisitorData on success
} catch (err) {
// handle IdentificationError
}Supported Native SDK Version Range
- Fingerprint iOS SDK Version Range:
~> 2.17.0 - Fingerprint Android SDK Version Range:
>= 2.17.0 and < 2.18.0
@fingerprintjs/fingerprintjs-pro-react-native@3.7.1-rethrow-rc.0
Patch Changes
- Pre-release for validation by customers pinned to the 3.7.x line.
- Functionally equivalent to
3.7.0plus a single addition: theuseVisitorData().getDatarethrow option shipped in 3.17.0 (callgetData(tags, linkedId, { throwOnError: true })to reject on error). - Cut from
main, but the mobile agents are pinned back tov2.10.0and the Proximity Detection init options added in3.8.0(allowUseOfLocationData,locationTimeoutMillisAndroid) are removed, so upgrading from3.7.0does not change identification behavior or the public API beyond the opt-in rethrow flag.
Example usage of the flag:
const { isLoading, error, data, getData } = useVisitorData()
try {
const visitorData = await getData(tags, linkedId, { throwOnError: true })
// visitorData is VisitorData on success
} catch (err) {
// handle IdentificationError
}Supported Native SDK Version Range
- Fingerprint iOS SDK Version Range:
~> 2.10.0 - Fingerprint Android SDK Version Range:
>= 2.10.0 and < 2.11.0
@fingerprintjs/fingerprintjs-pro-react-native@3.16.0
Minor Changes
-
Update mobile agents to v2.17.0
Supported Native SDK Version Range
- Fingerprint iOS SDK Version Range:
~> 2.17.0 - Fingerprint Android SDK Version Range:
>= 2.17.0 and < 2.18.0
@fingerprintjs/fingerprintjs-pro-react-native@3.15.0
Minor Changes
-
Update mobile agents to v2.16.0
Supported Native SDK Version Range
- Fingerprint iOS SDK Version Range:
~> 2.16.0 - Fingerprint Android SDK Version Range:
>= 2.16.0 and < 2.17.0
@fingerprintjs/fingerprintjs-pro-react-native@3.15.0-test.0
Minor Changes
-
Update mobile agents to v2.16.0