Reclaim Flutter SDK

Reclaim Protocol is a secure protocol that allows users to export their data from any website with provable authenticity, using HTTPS and zero-knowledge proof technology. The Reclaim Flutter SDK provides the full power of the Reclaim Protocol in a widget.

Flutter SDK UI

Features

Use this package in your Flutter app to:

  • Show a Reclaim widget that opens a UI equivalent to the Reclaim Protocol App.
  • Ask users to create a verficiation based on a provider created in the Reclaim Developer Tool.
  • Supports pop-ups which allows for OAuth flows like Google login to work.
  • Recieve proofs in your Flutter app and dispatch actions based on them.

Getting started

  • Get an Application ID from the Reclaim Developer Tool.
  • Create of choose a provider and get its ID from the dev tool.

Usage

  • Import the Reclaim package:
import 'package:reclaim_flutter_sdk/reclaim_flutter_sdk.dart';
  • Create the verification object from the class ReclaimVerification within your app:
reclaimVerification = ReclaimVerification(
    buildContext: context, // your build context
    appId: 'YOUR_APP_ID', // your application identifier from the dev tool
    providerId: 'aaa47198-2523-40da-b9a9-bfa290730d52', // your provider identifier from the dev tool
    secret: '', // your secret token of your application from the dev tool/
    context: '', // your claim context
    parameters: { /* ... */ }, // parameters to pre-inject in the provider response selections
)
  • Use the constructor withSignature to use your own generated signature and timestamp:
reclaimVerification = ReclaimVerification.withSignature(
    buildContext: context, // your build context
    appId: 'YOUR_APP_ID', // your application identifier from the dev tool
    providerId: 'aaa47198-2523-40da-b9a9-bfa290730d52', // your provider identifier from the dev tool
    signature: '', // { providerId, timestamp } signed using your application secret
    timestamp: 0, // the timestamp from the signature
    context: '', // your claim context
    parameters: { /* ... */ }, // parameters to pre-inject in the provider response selections
)
  • reclaimVerification.startVerification() is an async function that would return the proofs in the form of CreateClaimOutput on success:
class CreateClaimOutput {
  final String identifier;
  final ProviderClaimData claimData;
  final List<String> signatures;
  final List<WitnessData> witnesses;
}
  • Make sure to catch errors and handle them.

  • Check out the Example.

Additional information