Skip to main content

Optimizing SDK Performance for Edge AI: A Developer's Guide

Pick the native Didit SDK over WebView, pin 4.15.4, create sessions on your backend, respect rate limits and read decisions from webhooks. A full ID check is $0.33 per completed check.

Optimizing SDK Performance for Edge AI: A Developer's Guide

Contents

In this guide

Jump to the part you need.

This guide fits mobile and web teams that run Didit identity checks and biometric capture on phones, tablets and kiosks at the edge. A full ID check costs $0.33 per completed check. Every Didit SDK, the workflow orchestrator and the MCP server are free on every plan. The caveat: most of the speed comes from choosing the native SDK and the on-device capture path before you write any code.

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

Didit SDK surfaces for edge AI, minimum versions and list prices, November 26, 2026
SurfaceDistributionMinimum versionBest forList price
iOS native SDK 4.15.4Swift Package Manager, CocoaPodsiOS 13.0+, NFC needs iOS 15.0+iPhone and iPad apps that read NFC chipsSDK free, checks billed per module
Android native SDK 4.15.4Maven me.didit:didit-sdkAPI 23+ (Android 6.0)Android phones, tablets and kiosksSDK free, checks billed per module
React Native SDK 4.15.4npm @didit-protocol/sdk-react-nativeRN 0.76+ (New Architecture), iOS 13.0+, API 24+One TypeScript codebase on both storesSDK free, checks billed per module
Flutter SDK 4.15.4pub.dev didit_sdkFlutter 3.41+, Dart 3.11+, iOS 13.0+, API 23+Dart apps on low-power hardwareSDK free, checks billed per module
JavaScript SDK 0.4.0npm @didit-protocol/sdk-webAny modern browserBrowsers and embedded panelsSDK free, checks billed per module
InContext iframeUniLink or API sessionAny modern browserQuickest embed with no build stepSDK free, checks billed per module
WebViewYour app shellPlatform-dependent; use WebView only when no native SDK is available.Fallback only, no NFCSDK free, checks billed per module
Server SDKs7 languagesPython 3.10, Node.js 18, Go 1.22, Java 11, PHP 8.1, Ruby 3.1, .NET 8Creating sessions and verifying webhooksSDK free

Start free in the sandbox at business.didit.me, no sales call required. Developers who want an AI assistant to drive the integration can connect the Didit MCP server, and every current unit price sits on the pricing page.

The target is a verification flow that can complete in one session, with the decision delivered to your backend through a webhook. The recommended method is the documented SDK flow: your backend creates a session, the device runs the native SDK, and the webhook delivers the result. Standalone REST APIs are the alternative when you already own the capture UI or need server-to-server batch work, as described on docs.didit.me/integration/sdks. The integration prompt carries the same SDK flow if you want a coding agent to do the wiring, and every unit price is on the pricing page.

What an edge SDK does inside a Didit integration

On an edge device the SDK owns the parts that touch hardware. The SDK handles camera permissions, NFC reading, liveness detection and document capture. Didit's backend returns the decision. Your backend keeps the API key: it creates a session, the app presents the flow, and the decision arrives by webhook. The device never holds a credential that can spend your credit.

That split explains where the milliseconds go, and three clocks get mixed up in performance conversations. Device capture time is how long the camera, the NFC read and the upload take on the handset, and you control it with the native SDK and the number of steps you enable. Network time is the request and the response over the user's connection, and you control it by creating the session once on the backend and by reading the result from a webhook instead of polling. Published inference latency is the pipeline's own processing time, sub-2-second p99, and your app cannot tune it. Keep the three apart. Separately from latency, the document pipeline covers 14,000+ document types, and the native SDKs ship 54 capture and UI languages.

Prerequisites

  • A Didit organization and a workflow. The workflow id goes into the session create body.
  • An API key from the console API keys page, read by the SDKs from DIDIT_API_KEY.
  • A public HTTPS endpoint for the webhook and for the callback URL you pass at session creation.
  • Device floors: iOS 13.0 or later, Android API 23 or later, React Native 0.76 or later, Flutter 3.41 with Dart 3.11 or later.
  • A backend runtime the server SDKs support: Python 3.10, Node.js 18, Go 1.22, Java 11, PHP 8.1, Ruby 3.1 or .NET 8.
  • Sandbox access, which is free and unlimited, plus the $10 of monthly credit the Free plan gives organizations that sign up with a work email.

Eight steps to a faster edge integration

Step 1: Choose the native SDK for the device class

The Didit docs say to always prefer native SDKs over WebView and to use WebView only when no native SDK exists for the platform, because WebView loses NFC, camera optimization and biometric integration. iOS, Android, React Native and Flutter all have native SDKs at 4.15.4. A WebView flow on the same handset does more work with less hardware access.

Step 2: Pin the version and install it

  • iOS: Swift Package Manager from https://github.com/didit-protocol/sdk-ios, or CocoaPods pod 'DiditSDK'.
  • Android: Maven me.didit:didit-sdk from the Didit repository.
  • React Native: npm install @didit-protocol/sdk-react-native.
  • Flutter: didit_sdk on pub.dev.
  • Web: npm install @didit-protocol/sdk-web.

Pin the exact version in your lockfile. Native SDK 4.0 split the library into modular variants (Core, AutoDetection, NFC, All) with binaries about 84% smaller, which matters on low-storage, low-power hardware. Shipping only the variants a device needs is the cheapest performance win available to you. The two cross-platform wrappers need care as well. React Native 0.76 or later means the New Architecture. Flutter 4.15.4 and React Native 4.15.4 pin native 4.15.4 and add no Dart or JavaScript API of their own, so the native version you pin is the one that runs. Biometric consent, for people covered by Illinois, Texas or Colorado law, needs native 4.10.0 or later in both wrappers.

Step 3: Create the session on your backend

The session create call is the only place your API key appears. It returns the identifier and token the device needs.

curl -X POST https://verification.didit.me/v3/session/ \
  -H "x-api-key: $DIDIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_id": "DIDIT_WORKFLOW_ID",
    "callback": "https://myapp.com/done",
    "vendor_data": "internal-user-id"
  }'

Step 4: Start verification on the device

The two families of client start from different values in the same response. Native SDKs start from the session token: the docs show DiditSdk.startVerification(token: session_token) on iOS, Android, React Native and Flutter. The JavaScript SDK, the InContext iframe and the redirect method start from the verification URL.

import { DiditSdk } from '@didit-protocol/sdk-web';

DiditSdk.shared.onComplete = (result) => {
  switch (result.type) {
    case 'completed':
      console.log('Verification completed!');
      console.log('Session ID:', result.session?.sessionId);
      console.log('Status:', result.session?.status);
      break;
    case 'cancelled':
      console.log('User cancelled verification');
      break;
    case 'failed':
      console.error('Verification failed:', result.error?.message);
      break;
  }
};

// Start verification with the url returned by POST /v3/session/
DiditSdk.shared.startVerification({
  url: 'https://verify.didit.me/session/3FaJ9wLqX2Mz'
});
The face scanning step of a Didit verification running on a device camera
The face scanning step runs in the device camera. The SDK owns the capture and the liveness step; the decision comes back from Didit's backend.
The document scanning step of a Didit verification on a phone
Document capture happens on the device. The completed check is billed at its published module price.

Step 5: Read the decision from the webhook

Didit posts verification results to your endpoint with HMAC-SHA256 signing and bounded retries, and the server SDKs verify that signature for you. A poll loop works, but every poll is a GET request against your rate budget and every extra second is latency your user sees. Register the webhook once, then treat the session id as the join key between device and backend.

The liveness result attached to a session in the Didit Business Console
The console shows the same liveness result your webhook receives, so you can compare device behaviour with the recorded decision.

Step 6: Turn on request logging while you measure

Set DIDIT_LOG=debug and the SDK logs the method, path, status, duration and request id of every request, never the bodies or headers. Create one client per process and share it, so the connection pool is reused instead of rebuilt on each call. On edge runtimes with no process environment, pass the API key to the Node.js client as an option.

Step 7: Stay inside the rate limits

Didit rate limits that shape an edge integration
ScopeWhat it coversLimit
session-v2-createPOST /v3/session/600 per minute
session-decisionGET v1 and v2 decision paths100 per minute
generic-getAll GETs, including GET /v3/session/<id>/decision/600 per minute
session-add-imagesPOST and PATCH /session/<id>/add-images/10 per minute
session-update-kycPOST and PATCH /session/<id>/update-data/10 per minute
generic-writePOST, PATCH and DELETE outside ingestion300 per minute

Limits are applied per x-api-key, or per client IP when no key is sent, in a fixed 60-second window. Endpoint limits apply in addition to the global ones, and the first scope to pass its counter returns HTTP 429. Enterprise plans can raise the global limits and the session create, decision and PDF limits on request.

Step 8: Plan the fallback before you ship

Keep one documented escape hatch per platform. When iframe camera access is unreliable, the redirect method sends the user to the Didit-hosted page and returns them through your callback URL. When no native SDK exists for the platform, WebView keeps the flow alive at the cost of NFC and camera optimization. Gate optional steps by device: NFC reading is a $0.15 add-on that needs iOS 15.0 or later, so lower-cost hardware should take the document camera path.

What a correct run returns

A valid session create answers with the identifiers your device and backend pass around. The status starts at Not Started.

{
  "session_id": "uuid",
  "session_token": "jwt",
  "verification_url": "https://verify.didit.me/...",
  "status": "Not Started"
}

From there, the device presents the flow and the webhook reports the outcome. The session_token is what the native SDKs start with. The verification_url is what the JavaScript SDK, the iframe and the redirect method use.

Failure cases and recovery

Common failures in an edge integration and what to do next
What you seeMeaningRecoveryRetry?
401, credentials invalidThe key is wrong, malformed, revoked or expiredCheck DIDIT_API_KEY or create a new keyAfter fixing
402, check not paid forThe balance could not cover the callTop up, then resendAfter topping up
403, no permission or IP outside the key listNo key sent, scoped key without access, or IP blockedRead the body, then fix the key limitsAfter fixing
404, session not foundThe id is wrong or the session sits outside the key workflow limitsCheck the id and the key scopeNo
409, conflictA reused idempotency key or a step that already ranRead code and reload stateDepends on code
410, expiredThe session or invitation has expiredCreate a new sessionNo
429, rate limitedA scope counter is at zeroWait for Retry-After, then back off with jitterYes
500, 502, 503Unexpected error or a dependency unavailableRetry with backoff, contact support if it continuesYes
BIOMETRIC_CONSENT_UNSUPPORTED_SDKA native SDK below 4.10.0 cannot show the consent stepUpgrade the SDKNo

For 429 responses, treat Retry-After as the floor and layer exponential backoff with jitter on top, then stop after a small ceiling of about five attempts and alert your team. Sustained throttling usually means a runaway loop, not a spike.

Inputs and outputs

What goes in and what comes back in a Didit SDK integration
ItemWhere it comes fromUsed by
DIDIT_API_KEYConsole, API keysEvery server SDK, read from the environment
workflow_idConsoleSession create body
session_idSession create response and webhookReading the decision, joining device and backend records
session_tokenSession create responseNative iOS, Android, React Native and Flutter SDKs
verification_urlSession create responseJavaScript SDK, iframe and redirect
Decision statusWebhook or GET /v3/session/<id>/decision/Your case record

Which steps are paid and where the SDK's job ends

Installing an SDK, creating sessions and receiving webhooks cost nothing on their own. Didit bills per completed check from prepaid credit, and the pricing docs note that some no-match database lookups and retries are billable, so read that page before you build an automatic resubmit loop. The full list of unit prices is on didit.me/pricing. Sandbox testing is free and unlimited.

Paid lines a typical edge flow touches, list prices November 26, 2026
LinePriceUnit
Full ID check (ID document, passive liveness, face match 1:1, device and IP)$0.33completed check
ID document verification only$0.15check
NFC chip reading$0.15check, add-on
Active liveness$0.15check
Face Search 1:N$0.05search

The SDK does not decide anything. Decisions come back from Didit's backend, and whatever happens to a case after the decision, such as a manual review queue or an escalation to your compliance team, is your own process. That boundary is worth writing down for your team: performance work stops at the SDK, and everything after the decision is a decision your own operations team makes.

Worked cost example

Take 10,000 completed full ID checks in one month.

  • List price: 10,000 x $0.33 = $3,300.
  • Growth: $0.33 x 0.96 = $0.3168 per check, so 10,000 x $0.3168 = $3,168, plus the $99 monthly fee. The plan adds $115 of credit a month, which is used first.
  • Scale: $0.33 x 0.90 = $0.297 per check, so 10,000 x $0.297 = $2,970, plus the $299 monthly fee, with $350 of credit a month.
  • If 2,000 of those devices also read an NFC chip: 2,000 x $0.15 = $300, so the list total becomes $3,300 + $300 = $3,600.

Dropping biometrics to cut cost is the wrong lever. An ID document only check is $0.15, so 10,000 x $0.15 = $1,500, but you lose passive liveness and face match, which are the parts that make the check worth running.

Sources

To measure the flow on your own hardware, use the sandbox: create an organization at business.didit.me, no sales call, and run one session per platform you ship. Sandbox testing is free and unlimited.

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

What is an AI edge SDK?

An edge SDK is a library that handles capture and device interactions locally, while Didit's backend returns the verification decision. The edge work is camera handling, liveness detection and document capture. Didit ships native SDKs for iOS, Android, React Native and Flutter plus a JavaScript SDK for browsers, all at no cost.

Which Didit SDK should I use on a low-power device?

Use the native SDK for the platform: iOS 13.0 or later, Android API 23 or later, React Native 0.76 or later on the New Architecture, or Flutter 3.41 with Dart 3.11 or later. Native SDK 4.0 split the library into modular variants (Core, AutoDetection, NFC, All) with binaries about 84% smaller, which matters on low-storage hardware. Treat WebView as a fallback only.

Why is a native SDK faster than a WebView for on-device verification?

A WebView loses NFC, camera optimization and biometric integration, so the device does more work with less hardware access. The Didit docs say to always prefer native SDKs over WebView and to use WebView only where no native SDK exists. The native path also lets you gate features by device, for example NFC reading, which needs iOS 15.0 or later and costs $0.15 per check as an add-on.

How much does a Didit check cost per completed verification?

A full ID check is $0.33 per completed check: ID document verification at $0.15, passive liveness at $0.10, face match 1:1 at $0.05 and device and IP analysis at $0.03. Billing is per completed check from prepaid credit, and the Free plan includes $10 of monthly credit for organizations that sign up with a work email. Growth is $99 a month with 4% off every Didit price, and Scale is $299 a month with 10% off.

What is Didit's inference latency?

Didit publishes sub-2-second p99 inference latency for its pipeline. Separately, the document pipeline covers 14,000+ document types and the native SDKs ship 54 capture and UI languages. Latency you measure on your own devices also includes camera startup, upload and network time, so test the full flow rather than the check alone.

How do I get the verification result on my backend?

Didit posts the result to the webhook endpoint you register, with HMAC-SHA256 signing and bounded retries, and the server SDKs verify the signature for you. You can also read a decision directly with GET /v3/session/<id>/decision/. A webhook avoids repeated polling requests.

What are Didit's rate limits for session creation?

POST /v3/session/ is limited to 600 requests per minute per API key, while POST /session/<id>/add-images/ and POST /session/<id>/update-data/ are limited to 10 per minute. A request over the limit returns HTTP 429 with a Retry-After header. Enterprise plans can raise the global, session create, decision and PDF limits on request.

What happens when an SDK below 4.10.0 meets a biometric consent law?

For people covered by Illinois, Texas or Colorado law, Didit can ask for explicit biometric consent before the first face capture, and that step needs native SDK 4.10.0 or later. A native SDK below 4.10.0, or one that does not report its version, runs the session as before and the decision reports biometric_consent.status: "pending" with reason: "BIOMETRIC_CONSENT_UNSUPPORTED_SDK". Upgrade the SDK if you verify people in those states.

Can I run the Didit SDK on a phone without NFC?

Yes. NFC is an add-on at $0.15 per check that needs iOS 15.0 or later, and the rest of the flow runs without it. Gate the NFC step by device capability so lower-cost Android and iOS hardware takes the document camera path instead.

How do I debug slow or failing requests from a server SDK?

Set DIDIT_LOG=debug and the SDK logs the method, path, status, duration and request id of every request, never bodies or headers. Create one client per process and share it so the connection pool is reused. On edge runtimes with no process environment, pass the API key to the Node.js client as an option.

Is there published data on AI API and SDK adoption in identity verification?

Didit publishes its own operating numbers rather than survey research: 4,000+ companies in production, 220+ countries and territories, 25+ composable modules and 14,000+ document types. The price list is public as a page, as JSON and as a list price book, so the same numbers buyers see can be checked. Didit also publishes an integration prompt and a free MCP server for AI coding agents.

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.