✨Works out of the box guarantee. If you face any issue at all, hit us up on Telegram and we will write the integration for you.
logoReclaim Protocol Docs
Flutter SDK

Installation

Flutter SDK for Reclaim Protocol

The Reclaim Protocol SDK for Flutter (android & iOS) applications is ready and available upon request. Contact our team to discuss implementation details.

A Flutter SDK for integrating Reclaim's verification system directly into your Flutter applications. This SDK allows you to verify user credentials and generate proofs in-app.

Features

  • In-app verification flow
  • Customizable verification options
  • ZK Proof generation
  • Compatible when using Flutter "Add to App modules" in your native applications

Prerequisites

  • An Android application source code (Support for Android 5.0 or later).
  • An Android device or emulator running Android 5.0 or later.
  • A Reclaim account where you've created an app and have the app id, app secret.
  • A provider id that you've added to your app in Reclaim Devtools.

Get an API Key

Setup your project using the Get API Key guide.

Installation

Add the following to your pubspec.yaml:

dependencies:
  reclaim_inapp_flutter_sdk: ^latest_version

Usage

Basic Setup

  1. Import the SDK in your Dart file:
import 'package:reclaim_inapp_flutter_sdk/reclaim_inapp_flutter_sdk.dart';
  1. Initialize the SDK with your app credentials:

Following is an exmaple.

const String appId = String.fromEnvironment('APP_ID');
const String appSecret = String.fromEnvironment('APP_SECRET');
const String providerId = String.fromEnvironment('PROVIDER_ID');

Starting Verification

final sdk = ReclaimInAppSdk.of(context);
final proofs = await sdk.startVerification(
  ReclaimVerificationRequest(
    appId: appId,
    providerId: providerId,
    secret: appSecret,
    sessionInformation: ReclaimSessionInformation.empty(),
    contextString: '',
    parameters: {},
    claimCreationType: ClaimCreationType.standalone,
  ),
);

Configuration Options

The ReclaimVerificationRequest supports the following options:

  • appId: Your Reclaim application ID
  • providerId: The ID of the provider you want to verify against
  • secret: Your application secret (optional if using session information)
  • sessionInformation: Session information for authentication
  • contextString: Additional context for the verification
  • parameters: Custom parameters for the verification
  • claimCreationType: Type of claim creation (standalone or meChain)
  • autoSubmit: Whether to auto-submit the verification
  • hideCloseButton: Whether to hide the close button
  • webhookUrl: URL for webhook notifications
  • verificationOptions: Additional verification options

Error Handling

The SDK throws specific exceptions that you can handle:

try {
  final proofs = await sdk.startVerification(request);
} on ReclaimExpiredSessionException {
  // Handle expired session
} on ReclaimVerificationManualReviewException {
  // Handle manual review case
} catch (error) {
  // Handle other errors if required
}

Pre-warming

For better performance, you can pre-warm the SDK:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  ReclaimInAppSdk.preWarm();
  runApp(MyApp());
}

Example

Check out the example for a complete implementation.

Environment Variables

The SDK requires the following environment variables:

  • APP_ID: Your Reclaim application ID
  • APP_SECRET: Your application secret
  • PROVIDER_ID: The ID of the provider to verify against

You can provide these values using:

  • Dart Define Env file: --dart-define-from-file=./.env
  • Hardcoded values (not recommended for production)

Stay Updated

On this page