Skip to main content

How to Add Identity Verification to a Flutter App with Didit

Add verification to Flutter with our Flutter package on pub.dev: create the session on your backend, launch the native flow with the session token, then read the decision from webhooks. A full KYC check costs $0.33.

How to Add Identity Verification to a Flutter App with Didit

Contents

In this guide

Jump to the part you need.

We built our Flutter SDK for teams that want native document and selfie capture in their iOS and Android apps. It also supports NFC chip reading on compatible devices. A completed full KYC check costs $0.33 at list price, and sandbox testing is free. Create each session on your backend and send the app only the session token.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

Didit Flutter SDK at a glance, November 26, 2026
ItemWhat it is
Install routeNative listing on pub.dev as didit_sdk, version 4.15.4
PlatformsiOS 13.0+ (NFC on iOS 15+), Android API 23+ (Android 6.0)
ToolchainFlutter 3.41+, Dart 3.11+
Native captureDocument capture, liveness capture and NFC reading on supported devices
Workflow checksAML screening, proof of address, database validation and questionnaires are configured in the workflow, and their results arrive in the decision
Price per full KYC check$0.33 = ID $0.15 + passive liveness $0.10 + face match $0.05 + device and IP $0.03
SandboxFree and unlimited on every plan, with scenario slugs that force an outcome
Session creationPOST https://verification.didit.me/v3/session/ from your backend
Result deliveryWebhooks plus GET https://verification.didit.me/v3/session/{session_id}/decision/

What the Flutter SDK covers

Flutter SDK 4.15.4 pins native iOS and Android SDKs at 4.15.4. The native SDKs handle camera permissions, NFC reading and liveness capture.

Native SDK and hosted flow, compared on what a Flutter team ships
QuestionNative Flutter SDKHosted flow
Where the screens runNative iOS and Android views inside your appA Didit-hosted page opened from a link
Camera and NFCThe native SDKs handle camera permissions, NFC reading and liveness captureNo native dependency inside the app
Device flooriOS 13.0+ (iOS 15+ for NFC), Android API 23+Opens in the device browser.
What you change to ship itOne dependency in pubspec.yaml plus the iOS and Android settingsOpen the hosted URL returned by session creation. Both routes use the same backend session creation and decision handling. Configure a redirect callback if your hosted flow needs one.

A workflow defines which checks we run. A simple workflow runs them in a fixed order, and a node-based workflow can branch on results. The SDK presents the capture steps on the device.

  • Document capture. Document capture returns OCR results in id_verifications[]. The barcodes array is empty when the reader returns no barcode data. Version 4.15.4 moves the Document AI file upload option to the top of the Document AI step.
  • Liveness capture. The SDK records the selfie on the device. Passive liveness is $0.10 per check, active liveness is $0.15, and the 1:1 face match against the document portrait is $0.05.
  • NFC reading. Supported ePassports and chipped IDs, on devices that have NFC, at $0.15 per check as an add-on to the document step.
  • Workflow features. AML screening at $0.20 per check, proof of address at $0.20, database validation and custom questionnaires are switched on in the workflow, not coded in the app, and their results arrive in the decision arrays.
  • Languages. The capture flow and the native SDKs ship in 54 languages, set per session with language.
The document capture step of the Didit verification flow
The ID document step the Flutter SDK opens on the device camera.

Prerequisites

What you need before the first session
AreaRequirement
PlanThe Free plan includes $10 in monthly credit for the first organization created with an eligible work email for its company domain, and sandbox testing is free and unlimited on every plan. Growth is $99 a month with $115 of credit and 4% off Didit prices. Scale is $299 a month with $350 of credit and 10% off.
ClientFlutter 3.41+ and Dart 3.11+ on the machine doing the build. Devices need iOS 13.0+ or Android API 23+, and iOS 15+ for NFC.
API keyAn application key with permission to create sessions. Reading decisions needs the read:sessions privilege. Keep the key on the server.
Backend endpointOne HTTPS route that accepts the webhook POST and can verify X-Signature-V2.

Add identity verification to a Flutter app in 7 steps

  1. Create the application and keep two keys. Sign up at business.didit.me, create an Organization, and start with the sandbox key: everything below runs against sandbox before you switch to live. To register programmatically instead of through the console, follow the Quick Start, which covers POST https://apx.didit.me/auth/v2/programmatic/register/, the six-character code you post back to the verify-email step, and the keys the responses return. Save the sandbox key as DIDIT_API_KEY and the live key as DIDIT_LIVE_API_KEY.

  2. Create a workflow and keep its UUID. This half of the setup is where workflow_id comes from. Open Workflows in the console, click New workflow, pick Verifying users, then describe the checks, start from a template or start empty. You can also create it with the API and keep the returned id.

    curl -X POST https://verification.didit.me/v3/workflows/ \
      -H "x-api-key: $DIDIT_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "workflow_label": "Standard KYC",
        "workflow_type": "kyc",
        "features": [
          {"feature": "OCR"},
          {"feature": "LIVENESS", "config": {"face_liveness_method": "PASSIVE"}},
          {"feature": "FACE_MATCH"},
          {"feature": "AML"}
        ]
      }'

    The KYC template covers standard user onboarding, Adaptive Age Verification runs a selfie age check with an ID fallback, and each template says whether it is simple or advanced. The request enables AML screening. Sandbox runs are free. At live list prices, a completed full KYC check that includes ID verification, passive liveness, face match and device and IP analysis costs $0.33. A completed AML check adds $0.20, for a total of $0.53. Keep the workflow UUID and the API key in the same environment, because a sandbox key only reaches sandbox objects and a live key only reaches live ones.

  3. Create the session on your backend. Keep the API key in your backend environment and send only the session token to the Flutter app. The vendor_data value is your own user id: it binds the session to your record and drives duplicate detection. Build the body with a JSON encoder that reads the shell variable, so the API receives the UUID and not the literal text $WORKFLOW_ID.

    BODY=$(jq -n --arg workflow_id "$WORKFLOW_ID" \
      '{workflow_id: $workflow_id, vendor_data: "user-42", callback: "myapp://kyc/return"}')
    curl -X POST https://verification.didit.me/v3/session/ \
      -H "x-api-key: $DIDIT_API_KEY" \
      -H "Content-Type: application/json" \
      -d "$BODY"

    If the application has allowed domains configured, an HTTP or HTTPS callback must match an allowed origin by scheme, host and port. A mismatch returns HTTP 400. Custom URL schemes are accepted. The response carries session_id, url and session_token, so send only the token to the app. The create session reference lists the optional fields, including expected_details, contact_details and session_expiration_time.

  4. Add the package to the Flutter project.

    flutter pub add didit_sdk

    Beside the install, set the platform floor the package needs. The core SDK supports iOS 13.0 or later and Android API 23 or later. NFC on iOS requires a compatible device running iOS 15 or later. The Flutter SDK guide has the Podfile entry for iOS and the Gradle configuration for Android, and 4.15.4 pins native 4.15.4 on both platforms.

  5. Launch the flow with the token. Call the SDK entry point from the screen where onboarding happens, pass the session token returned by your authenticated backend, and await the result callback. The Flutter SDK guide lists the exact Dart signature and the result types it returns. The native screens cover the document step, the selfie and liveness steps, the NFC read when the workflow asks for it and the proof of address step if you added one. If a started session remains unfinished when its window ends, we mark it Abandoned. An unopened session becomes Expired at timeout.

  6. Register a webhook destination. Subscribe explicitly, because there is no wildcard. The response carries a secret_shared_key you store as DIDIT_WEBHOOK_SECRET.

    curl -X POST https://verification.didit.me/v3/webhook/destinations/ \
      -H "x-api-key: $DIDIT_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"label": "Production", "url": "https://myapp.com/webhooks/didit", "subscribed_events": ["status.updated", "data.updated"], "webhook_version": "v3"}'

    In the handler, read the raw body first, then compute HMAC-SHA256 over the sorted, Unicode-preserving canonical JSON with the destination secret and compare it in constant time. Reject the request when the absolute difference between now and X-Timestamp is more than 300 seconds. De-duplicate on event_id and answer 2xx within 5 seconds. While you deploy a rotated secret, accept a matching signature from the current header or from the previous-signature header, each checked with its own secret. The webhook guide has the full recipe.

  7. Read the decision as the fallback path. When a webhook is late or you need the complete record, fetch it. Branch on session_kind and read the plural arrays, never a singular field.

    curl https://verification.didit.me/v3/session/SESSION_ID/decision/ \
      -H "x-api-key: $DIDIT_API_KEY"

    The response holds id_verifications[], liveness_checks[], face_matches[], nfc_verifications[], aml_screenings[] and poa_verifications[] for a user session, and decision_trace explains how the status was reached. See the retrieve session reference.

The selfie and liveness capture screen
The SDK captures the selfie on the device. Read the liveness result in the decision's liveness_checks array.

What the app does when the flow closes

The SDK callback tells the app that the flow closed. It is not the decision, and the app should never grant access from it. Your backend already holds the session, so it applies the outcome and the app asks your backend what to show.

  • Approved. The status.updated event carries the full decision. The backend flips the account to verified, and the app moves the person to the signed-in home screen on the next status check.
  • In Review. A reviewer has to look at the warnings. Keep the account pending, tell the person their documents are being checked, and do not ask for the same documents again.
  • Declined. Show a plain explanation and a support route. If your policy allows a resubmission, a reviewer or the update-status endpoint can move the session to Resubmitted.
  • Closed early or failed. If the app closes early or encounters a network error, fetch the current session status from your backend before offering a retry. An opened session that stays unfinished becomes Abandoned at timeout. An unopened session becomes Expired. For a new attempt after either timeout, create a new session with the same vendor_data.

Field and event mapping

What your Flutter app and your backend read, and what Didit returns
In your app or backendDidit field or eventWhat to do with it
session_tokenReturned by POST /v3/session/Hand the session token to the SDK on the device. Keep it out of logs.
vendor_dataSession fieldYour stable user or account id. Used for duplicate detection across sessions.
callbackSession fieldCustom URL schemes are always accepted. If allowed domains are configured, an HTTP or HTTPS callback must match one by scheme, host and port.
languageISO 639-1 codeSets the verification UI language for that session only.
statusExact string on session decisions and session webhooksMatch strictly: Approved, Declined, In Review, In Progress, Not Started, Expired, Abandoned, Resubmitted, Kyc Expired. Note the single capital K in Kyc Expired. Awaiting User belongs to KYB sessions only, and entity events such as user.status.updated carry their own values.
id_verifications[]Decision arrayDocument result with OCR fields. barcodes is always an array, empty when the document has none.
liveness_checks[], face_matches[]Decision arraysBiometric results. Absent or null when the feature did not run.
nfc_verifications[] and nfc_skip_reasonDecision array plus a top level stringChip result and why it did not run: USER_SKIPPED, DOCUMENT_WITHOUT_CHIP, DEVICE_WITHOUT_NFC and others.
X-Signature-V2 and X-TimestampWebhook headersRead the raw request body, follow the documented canonicalization for X-Signature-V2, and verify the signature before trusting the event or updating state. Keep the absolute time difference from X-Timestamp within 300 seconds. For 24 hours after a rotation, accept a matching signature from the current or the previous header, each with its own secret.
status.updated, data.updatedwebhook_typeSubscribe to each family you need. There is no wildcard, and a delivery is dropped after two retries.

Test with sandbox data

Sandbox testing is free and unlimited on every plan. Use the supplied sample documents and magic values to test without submitting real personal data. Use sandbox_scenario on session creation to force an outcome. The catalogue comes from GET /v1/sandbox/scenarios/, and a scenario expands its bundled magic values onto contact_details and expected_details so the flow reproduces that result. The field is rejected with 400 on live applications.

BODY=$(jq -n --arg workflow_id "$WORKFLOW_ID" \
  '{workflow_id: $workflow_id, vendor_data: "test-user-1", sandbox_scenario: "decline_aml_hit"}')
curl -X POST https://verification.didit.me/v3/session/ \
  -H "x-api-key: $DIDIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$BODY"

You can also arm or re-arm a scenario after creation with POST /v3/session/{session_id}/sandbox/arm/ while the session is still Not Started. The sandbox guide lists the sample documents, magic values and OTP codes to type into the phone and email steps.

Expected success. Run the native capture steps on a supported physical device, since a simulator cannot stand in for the camera and the chip reader. Check that the webhook carries the session ID and environment is sandbox. Look for the expected status. A session webhook includes a decision for Approved, Declined, In Review or Abandoned. Inspect the result arrays for the checks that ran.

Error cases and fixes

Failure modes you will hit while wiring a Flutter app
SymptomCauseFix
403 with You do not have permission to perform this action.The API key is missing, or the key lacks the privilege required by this endpointCheck that x-api-key is sent, then check the key's privileges, including read:sessions for the decision endpoint.
401 on verification.didit.meInvalid, revoked or expired keyIssue a new key in the console and update the server environment variable.
400 on session createUnknown or wrong workflow_id, or a key from another environmentRe-read the workflow id, confirm the workflow is published, and confirm the UUID and the key come from the same environment.
400 mentioning allowed domainsAn HTTP or HTTPS callback outside your allowed originsAdd the origin or use a custom scheme deep link.
404 on the decision endpointWrong session id, or the session belongs to another applicationConfirm you are using the key from the same application that created the session.
Webhook delivery failed or was retriedThe handler timed out, or answered 5xx or 404Check the destination delivery log for a timeout, 5xx or 404, acknowledge valid events with 2xx within five seconds, and use the delivery log to resend after the retries are exhausted.
Session sits at Not StartedThe person never opened the linkSend a reminder, or create a new session with the same vendor_data.
Consent decision shows BIOMETRIC_CONSENT_UNSUPPORTED_SDKThe native SDK is below 4.10.0 or does not report its versionBump didit_sdk. Flutter 4.15.4 pins native 4.15.4.
A liveness result for one session in the Didit Business Console
The same liveness result your webhook receives, shown to reviewers in the Business Console.

Disconnecting the integration

Stop creating sessions on your backend and remove the SDK entry point from future app builds.

Flutter KYC pricing and monthly cost

You pay per completed check from prepaid credit. A full KYC check is $0.33, built from ID document $0.15, passive liveness $0.10, face match 1:1 $0.05 and device and IP analysis $0.03. NFC reading is $0.15 per completed read, AML screening is $0.20 per completed check and proof of address is $0.20 per completed check. The published active liveness rate is $0.15 per check. The SDK, the Workflow Orchestrator and the MCP server are free, and sandbox sessions never bill.

Worked example. Use a live workflow that runs ID verification, passive liveness, face match and device and IP analysis, plus NFC reading, with AML omitted. Assume 20,000 completed full KYC checks per month and 3,000 completed NFC reads, equal to 15% of those checks.

  • Full KYC: 20,000 x $0.33 = $6,600.00
  • NFC reading: 3,000 x $0.15 = $450.00
  • List price total: $6,600.00 + $450.00 = $7,050.00 per month
  • Scale monthly cost, assuming the full monthly credit is available: (20,000 x $0.297) + (3,000 x $0.135) - $350.00 + $299.00 = $6,294.00

The same volume on Growth, at 4% off: 20,000 x $0.3168 = $6,336.00 plus 3,000 x $0.144 = $432.00, which is $6,768.00 of usage, minus $115.00 of credit plus the $99.00 fee = $6,752.00. For each completed AML check, add $0.20 at list price, $0.192 on Growth or $0.18 on Scale.

Plan credit is applied to usage first and does not roll over, and top-ups last 12 months. Read the current numbers on the pricing page and the billing rules in the docs before you model a forecast.

Sources

Start in the sandbox at business.didit.me. The Free plan includes $10 in monthly credit for the first organization created with an eligible work email for its company domain, sandbox sessions cost nothing, and no sales call is needed to create your first session.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alejandro Rosas

Co-founder and CTO

Alejandro Rosas

Alejandro Rosas

Co-founder and CTO

About Didit

Questions

Frequently asked questions

How do I add KYC to a Flutter app?

Your backend creates a session with POST https://verification.didit.me/v3/session/ and returns the session token to the app. The app launches the native flow from didit_sdk with that token. Your backend receives the decision by webhook and stores it against the vendor_data you sent, so the API key never leaves the server.

Is there an official Didit Flutter SDK on pub.dev?

Yes. The package is didit_sdk, at version 4.15.4 on November 26, 2026, and it pins the same native version on iOS and Android. The Flutter SDK guide covers installation and the platform configuration, and the SDK overview lists every platform and its minimum versions.

What Flutter, Dart, iOS and Android versions do I need?

Flutter 3.41 or later and Dart 3.11 or later. The core SDK supports iOS 13.0 or later and Android API 23 or later. NFC on iOS requires a compatible device running iOS 15 or later, so check your pubspec.yaml and your Gradle and Podfile targets before you start.

Can the Flutter SDK read ePassports and chipped IDs over NFC?

The Flutter SDK can read supported ePassports and chipped IDs on NFC-capable devices running iOS 15 or later or Android API 23 or later. If the chip read does not run, inspect nfc_skip_reason in the decision. Reading is a $0.15 add-on to the document check, priced separately from the $0.15 document step.

Do I create the session in the app or on my server?

On your server, always. The create call needs the x-api-key header, and shipping that key inside a Flutter binary hands it to anyone who unpacks the app. The app should only ever hold the session token returned by your authenticated backend.

How much does one Flutter KYC check cost?

$0.33 for the full KYC bundle: ID document $0.15, passive liveness $0.10, face match 1:1 $0.05 and device and IP analysis $0.03. NFC reading adds $0.15, AML screening adds $0.20 and proof of address adds $0.20. The Free plan includes $10 in monthly credit for the first organization created with an eligible work email for its company domain, Growth is $99 a month with 4% off and Scale is $299 a month with 10% off.

How do I test the Flutter flow without real documents?

Use the sandbox application key and pass a sandbox_scenario when you create the session. The scenario expands its magic values onto the expected details, so the flow reproduces a specific outcome such as a passing check or an AML hit. The sandbox guide lists the sample documents and OTP codes, and no sandbox session is billed.

Which webhook events should a Flutter integration subscribe to?

Start with status.updated and data.updated, which fire when a session's status changes or its verification data is edited. There is no wildcard event, so add each family you need. Verify X-Signature-V2, answer 2xx within 5 seconds and de-duplicate on event_id.

What happens if the user closes the app mid verification?

If a started session remains unfinished when its window ends, we mark it Abandoned, while an unopened session becomes Expired at timeout. Either way you can create a new session with the same vendor_data. Set session_expiration_time if you want a shorter or longer window than the workflow default, between 3,600 and 2,419,200 seconds.

Does the SDK handle biometric consent for Illinois, Texas and Colorado?

Yes. In Auto consent mode, supplying the person's state of residence in user_state triggers explicit consent before the first face capture for Illinois, Texas or Colorado. If you supply previously collected consent in biometric_consent, the flow records it and skips the prompt. Flutter 4.15.4 pins a supported native version. For affected sessions on a native SDK below 4.10.0 or one that does not report its version, the decision records pending with reason BIOMETRIC_CONSENT_UNSUPPORTED_SDK. See biometric consent.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.