FingerprintJS Pro Flutter is an official open-source library for the Flutter ecosystem. The package is also published at pub.dev package repository.

Sample usage

  1. Add fpjs_pro_plugin to the pubspec.yaml in your Flutter app.
dependencies:
  flutter:
    sdk: flutter
  ...
  fpjs_pro_plugin: ^1.2.1
  1. Identify the visitor
import 'package:fpjs_pro_plugin/fpjs_pro_plugin.dart';
// ...

// Initialization
class _MyAppState extends State<MyApp> {
  @override
  void initState() async {
    super.initState();
    await FpjsProPlugin.initFpjs('<public-api-key>'); // insert your public API key here
  }
  // ...

  void identify() async {
    try {
      visitorId = await FpjsProPlugin.getVisitorId() ?? 'Unknown';
      deviceData = await FpjsProPlugin.getVisitorData();
      // use the visitorId or deviceData with more info about the visitor
    } on PlatformException catch (e) {
      // process an error somehow
    }
  }
}

Documentation

You can find the full documentation in the official GitHub repository. The repository also contains an example app demonstrating usage of the library.


Did this page help you?