CredflareDevelopersOpen dashboard
Preview

Flutter SDK

A guided native flow for Android and iOS that collects the requested documents, runs the liveness challenge and location step, and sends the evidence for review.

Not published yet. The package name will be credflare_sdk. Until then, add it as a path or git dependency from credflare/flutter-sdk on GitHub.

Add the guided flow

import 'package:credflare_sdk/credflare_sdk.dart';

CredflareVerification(
  sessionProvider: () async {
    final response = await api.post('/credflare/session'); // your backend
    return SessionDescriptor.fromJson(response);
  },
  onClose: () => Navigator.of(context).pop(),
  onSubmitted: (info) => refreshStatus(),
)

sessionProvider calls your own authenticated backend, which creates the session as shown in the server example. SessionDescriptor.fromJson rejects a non-HTTPS API URL outside localhost.

ParameterPurpose
sessionProviderReturns a session descriptor from your backend. Required.
onCloseCalled when the applicant closes the flow or presses Done. Required.
onSubmittedCalled once nothing is left to collect. It receives the session info, not a decision.
onCancelledCalled when the applicant leaves before finishing. The case stays open.
onHostActionRequiredCalled with the rejection code before onClose when the applicant leaves from a leave rejection, so your app can follow up.
autoStartSkips the Start screen and loads the session at once.
httpClientAn optional http.Client, for example to add your own logging or tests.
livenessSourceReplaces the camera source for the liveness step.
locationSourceReplaces the location source.

After the documents, the flow asks the outstanding questions, then runs the case's facial, location, email and phone requirements in profile order, and shows a receipt once everything required is in. A questionnaire with a founders question returns control to your app.

Liveness and location

Questions and codes

Not yet on production: questions, email and phone codes, fetching the session after each submit, rejection screens with a help contact. They need API and SDK versions that are not released yet.

Build your own screens

Use CredflareSessionController to load the session and CredflareDocumentCapture for one document. captureSteps(requirement), methodSummary(requirement) and isCaptureSupported(requirement) match the JavaScript helpers.

CredflareDocumentCapture(
  session: session,
  requirement: requirement,
  requesterName: info['requester']?['name'],
  maxFileSizeBytes: info['upload_limits']['max_file_size_bytes'],
  allowedFileTypes: List<String>.from(info['upload_limits']['allowed_file_types']),
  onSubmitted: (submissionId) => reloadRequirements(),
  onDirtyChanged: (hasUnsentFiles) => guardLeave = hasUnsentFiles,
)

To call the API directly, session.upload takes documentTypeId, side and source, and session.submit takes the same evidence list as the JavaScript client. Create keys with requestKey() and reuse them on retry.

Configure the app

Read how the SDKs work for capture methods, receipts and error handling.