> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fingerprint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Flutter

Fingerprint Flutter is an [official open-source library](https://github.com/fingerprintjs/fingerprintjs-pro-flutter) for the Flutter ecosystem. The package is also published at [pub.dev](https://pub.dev/packages/fpjs_pro_plugin) package repository. This library supports Android, iOS, and web platforms. View our [Flutter quickstart](/docs/v3/flutter-quickstart) for a step-by-step guide to get started.

## Requirements

The Flutter SDK uses the [Android](/docs/native-android-integration) and [iOS](/docs/ios) SDKs under the hood, so it has the same minimum OS version requirements:

* Android 5.0 (API level 21+) or higher
* iOS 13+/tvOS 15+, Swift 5.7 or higher
* Flutter 3.13 or higher
* Dart 3.3 or higher

## 1. Install the plugin

Add `fpjs_pro_plugin` to the `pubspec.yaml` file in your Flutter app:

```yaml YAML theme={"theme":"github-dark-dimmed"}
dependencies:
  flutter:
    sdk: flutter
  ...
  fpjs_pro_plugin: ^3.3.2
```

Run `flutter pub get` to download and install the package.

To use this plugin on the web, add the JavaScript agent loader `<script>` tag to the `<head>` of your HTML template inside the `web/index.html` file:

```html HTML theme={"theme":"github-dark-dimmed"}
<head>
  <!-- ... -->
  <script src="assets/packages/fpjs_pro_plugin/web/index.js" defer></script>
</head>
```

## 2. Identify visitors

```dart Dart theme={"theme":"github-dark-dimmed"}
import 'package:flutter/material.dart';
import 'package:fpjs_pro_plugin/fpjs_pro_plugin.dart';
import 'package:fpjs_pro_plugin/error.dart';
import 'package:fpjs_pro_plugin/region.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initFingerprint();
  }

  // Initialize Fingerprint
  void initFingerprint() async {
    await FpjsProPlugin.initFpjs(
      'PUBLIC_API_KEY', // insert your API key here
      region: Region.us, // Insert the data region of your Fingerprint workspace
    );
    identify();
  }

  // Identify visitor
  void identify() async {
    try {
      var visitorId = await FpjsProPlugin.getVisitorId();
      var visitorData = await FpjsProPlugin.getVisitorData();

      print('Visitor ID: $visitorId');
      print('Visitor data: $visitorData');
    } on FingerprintProError catch (e) {
      // Process the error
      print('Error identifying visitor: $e');
    }
  }

  // ...
}
```

### Documentation

You can find the full documentation in the [official GitHub repository](https://github.com/fingerprintjs/fingerprintjs-pro-flutter). The repository also contains [an example app](https://github.com/fingerprintjs/fingerprintjs-pro-flutter/tree/main/example) demonstrating usage of the library.
