5.0.0 is built on the v4 native SDKs: the Android SDK and the iOS SDK. On web, it uses JavaScript agent v4. All platforms return the v4 event format. It introduces breaking changes, so you must migrate your integration manually. v5 changes the public API and your project’s minimum Flutter, Dart, Android, iOS, Xcode, and build-tool versions. It does not change identification or Smart Signals accuracy.
What’s new
- On Android and iOS, the SDK uses native SDK v4 (
4.1.x) instead of v2. Only native patch releases are picked up automatically. - The package is renamed from
fpjs_pro_plugintofingerprint_flutter, and the GitHub repository moved fromfingerprintjs/fingerprintjs-pro-fluttertofingerprintjs/flutter. - The static
FpjsProPluginAPI is replaced by aFingerprintclient instance with a singleget()method. - Platform-specific options are grouped under
android,ios, andweb, andendpointandendpointFallbacksare replaced by a singleendpointslist. - The result is a flat
FingerprintResult.requestIdis renamed toeventId, and the extended response fields are removed. - All error subclasses are replaced by a single
FingerprintErrorwith acodefield. - Timeouts use
Durationinstead of milliseconds. - On web, the SDK uses JavaScript agent v4, bundled in the package.
- The constructor and
get()validate their arguments and throwArgumentErrorfor invalid values. - The minimum versions are Flutter 3.44.0, Dart 3.12.0, Android 7.0 (API level 24), and iOS 15 with Xcode 16 and Swift 6.
Migration steps
Update your environment
Make sure your app meets the new minimum versions:
v5 also requires Xcode 16 or higher.
- On iOS, update the
platform :iosline inios/Podfileif you use CocoaPods, and the iOS deployment target in Xcode. - On Android, set
minSdkto24or higher inandroid/app/build.gradle(orbuild.gradle.kts). - The plugin no longer applies the Kotlin Gradle plugin, so it builds with Android Gradle plugin (AGP) 9. If your app still uses AGP 8, use Kotlin Gradle plugin 2.2.20 or higher.
- The plugin no longer adds the
jitpack.ioMaven repository to your Gradle project. If your app depends on packages from JitPack, addmaven { url 'https://jitpack.io' }to your repositories yourself.
Replace the package
Inpubspec.yaml, replace fpjs_pro_plugin with fingerprint_flutter:
pubspec.yaml
flutter pub get. Then update your imports. The new package exports all public types from a single library:
Dart
If your app targets web, update the loader script in
web/index.html:
web/index.html
Create a Fingerprint client
FpjsProPlugin.initFpjs() is replaced by the Fingerprint constructor. The constructor is synchronous, so you don’t need to await it. It starts the client in the background, and errors from starting the client surface when you call get(). The constructor itself throws in these cases:
ArgumentErrorif anendpointsentry is not anhttporhttpsURL, or ifandroid.locationTimeoutis under 1 millisecond.FlutterErroron Android and iOS if the Flutter binding doesn’t exist yet. CallWidgetsFlutterBinding.ensureInitialized()before you create the client, as you did beforeinitFpjs().
getVisitorId() and getVisitorData() are replaced by a single get() method.
Dart
Update identification options
get() accepts tags and linkedId like getVisitorData(). timeoutMs is replaced by timeout, which takes a Duration.
get() now validates its arguments and throws ArgumentError before identifying if:
tagsis not JSON-compatible. Keys must be strings, and values must be strings, finite numbers, booleans,null, lists, or nested maps. Typed lists such asUint8Listare rejected.timeoutis under 1 millisecond.
tags are JSON-compatible before you upgrade.
Dart
Update client options
Options that apply to one platform only are grouped inAndroidOptions, IosOptions, and WebOptions. endpoint and endpointFallbacks are replaced by a single endpoints list.
Dart
WebOptions. Caching is off by default. See Web options in the Flutter SDK README and the JavaScript agent cache option.
Update result fields
The result is now a flatFingerprintResult:
visitorId is null when the visitor ID is hidden, for example in Zero Trust Mode.
v5 also adds these fields:
suspectScore: the Suspect Score, if available. It is not a replacement for the confidence score. A higher value means a more suspicious request.cacheHit:truewhen the result came from the web cache.nullon web unlessWebOptions.cacheis set, and alwaysnullon Android and iOS.
FingerprintJSProResponse and FingerprintJSProExtendedResponse types are removed. To get the data from the removed fields, send eventId to your backend and get the full event with the Server API.
Dart
Update error handling
TheFingerprintProError subclasses, such as TooManyRequestError and ClientTimeoutError, are replaced by a single FingerprintError class. Compare error.code with the constants on FingerprintError instead of checking the error type.
FingerprintError does not extend PlatformException. If your code catches SDK errors with on PlatformException, it still compiles but no longer catches them. Catch FingerprintError instead.
Dart
Error codes are the same on Android, iOS, and web where the platforms share the error. Network failures report the
network_error code on all platforms. The list of codes can grow in future versions, so add a generic fallback for codes you don’t handle. For the full list, see the FingerprintError constants.