Skip to main content

Add passkey sign-in to a React Native or Expo app

Our React Native SDK 0.1.4 adds passkey sign-in. Expo needs a development build. Authentication is free for the first 50,000 active users each month, then $0.02 per additional active user that month.

Add passkey sign-in to a React Native or Expo app

Contents

In this guide

Jump to the part you need.

We built @didit-protocol/auth-react-native 0.1.4 for teams adding passkey sign-in to a React Native or Expo app. It fits apps on React Native 0.77 with the New Architecture that want a passkey button beside our hosted sign-in page. Sign-in is free for the first 50,000 active users each month, then $0.02 per active user month. The caveat: Expo Go cannot load the native module, so you need a development build.

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

React Native and Expo passkey sign-in with Didit at a glance
ItemWhat you get
Package@didit-protocol/auth-react-native 0.1.4 on npm
Native modulesAuthentication 4.15.4, resolved as me.didit:didit-auth on Android and the DiditSDK/Auth pod on iOS
React Native0.77 with the New Architecture
AndroidAPI 24 minimum; passkeys need Android 9 or later
iOS15.0 minimum; the hosted pages need iOS 17.4 at run time
ExpoA development build. Expo Go cannot load the native module
Token storageiOS Keychain or storage protected by the Android Keystore; refresh tokens never reach JavaScript
Passkey registrationregisterPasskey() needs a session at most five minutes old
PriceFirst 50,000 active users each month free, then $0.02 per active user month

Start free in the sandbox at business.didit.me, with no sales call. Every sandbox application has Authentication turned on from the start. If you want a coding assistant to read our documentation while you build, connect it through the Didit MCP server. Plans and every unit price are on didit.me/pricing.

What the package gives you

Our package opens your application's hosted Didit page, keeps the session in the iOS Keychain or the Android Keystore, and exposes a small API. One instance per application covers sign-in, passkey sign-in, passkey registration, re-authentication, session reads, tokens, sign-out and step-up.

import { createDiditAuth } from '@didit-protocol/auth-react-native';

// One instance per application. Use your sandbox key while you build.
const auth = createDiditAuth({
  publishableKey: 'pk_test_...',
  redirectUri: 'https://app.example.com/didit/callback',
});

// First use: hosted sign-up or sign-in, then enroll a passkey.
const session = await auth.signIn(); // hosted page: sign-up and sign-in
const passkeyId = await auth.registerPasskey(); // needs a session at most five minutes old

// Returning user who already has a passkey available on this device.
const returning = await auth.signInWithPasskey();

await auth.currentSession(); // DiditSession or null (cached for 30 seconds; { force: true } asks Didit now)
await auth.getToken(); // string or null: a five-minute JWT for your backend, renewed before it expires
await auth.signOut(); // signs out here at once, then ends the session at Didit when reachable

Two behaviours matter in production. The hosted sign-in is bound to its start with PKCE (S256) and a random state, so a redirect for any other sign-in is refused, and closing the page rejects with cancelled. Refresh tokens stay in the Keychain or the Keystore and never reach JavaScript.

signInWithPasskey() is the alternative to the hosted page when the person already has a passkey available on this device. registerPasskey() creates one, and the five-minute window means you call it right after sign-in, not from a settings screen opened an hour later. If the session is more than five minutes old, call reauthenticate() to sign the same person in again, then call registerPasskey() from the new session. Use { method: 'passkey' } only if a passkey is already available on the device.

Identity verification has its own package, @didit-protocol/sdk-react-native. Both can be installed in one app, because they pin the same native release 4.15.4. The React Native quickstart documents the SDK calls shown here, the canonical product page for the hosted sign-in pages is Didit Authentication, and the published per-unit prices sit on didit.me/pricing.

Didit biometric authentication screen shown when a step-up check runs
Biometric Authentication by Didit: the check a step-up can ask for before a payout, a bank change or a contact change.

Prerequisites

What you need before the first passkey sign-in
RequirementMinimum or valueWhere it lives
Didit planAny plan. The sandbox is free on every plan. The Free plan includes $10 in monthly credit for the first organization created with an eligible work email for a company domain. The credit does not cover phone verification codesdidit.me/pricing
ApplicationA Sandbox application, where Authentication is on from the start. A Live application turns it on from the Products pageDidit Business Console
Console accessOpening Authentication, Security and sessions, and DevelopersDidit Business Console
ClientReact Native 0.77 or later with the New Architecture. For Expo, use a development buildYour repository
AndroidAPI 24 minimum; passkeys need Android 9 or laterYour Android build files
iOS15.0 minimum; the hosted pages need iOS 17.4 at run timeios/Podfile
KeyPublishable key pk_test_... or pk_live_.... It is public, and no Didit secret belongs in the appAuthentication, Developers
RedirectAn HTTPS URI registered exactly as the app sends it. We accept no custom URL schemesAuthentication, Security and sessions
Sign-in methodpasskey enabled with PUT methods/passkey/ and a body of {"enabled": true}Authentication management API

Seven steps to passkey sign-in in a development build

  1. Turn on Authentication and the passkey method. A sandbox application has Authentication on from the start, so you can test straight away. A Live application turns it on from the Products page of the console. Then enable the method with PUT methods/passkey/ and a body of {"enabled": true}, using a console session, an owner-approved management grant or an authentication-scoped API key. The passkey method has no additional method-specific fields in the Authentication management API. Complete the native redirect and passkey setup in step 5. The hosted page shows only the methods you enabled.

  2. Register the redirect URI and copy the publishable key. Add your HTTPS redirect under Authentication, Security and sessions and copy the publishable key from Authentication, Developers. We match the registered value exactly, so a mismatch fails the code exchange. Use HTTPS on a domain you control: a custom URL scheme will not work.

  3. Install the package.

    npm install @didit-protocol/auth-react-native

    Configure the native dependencies and platform redirects before rebuilding the app.

  4. Configure the native dependencies, then install pods where they apply. On Android nothing else is needed: the package adds our Maven repository for the me.didit group only, and Gradle resolves me.didit:didit-auth from it. If your android/settings.gradle sets repositoriesMode to PREFER_SETTINGS, which ignores repositories added by a build file, list https://raw.githubusercontent.com/didit-protocol/sdk-android/main/repository there as well. On iOS, CocoaPods is the default, so name the podspec at the pinned version in ios/Podfile:

    pod 'DiditSDK/Auth', :podspec => 'https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.15.4/DiditSDK.podspec'

    To resolve it with Swift Package Manager instead, set $DiditSdkIosLinkage = 'spm' before use_native_modules! and leave the pod line out. The package then adds the DiditAuth product of sdk-ios. With the iOS dependencies configured, run cd ios && pod install.

  5. Complete the redirect and passkey setup on each platform. We return the person to your app with an HTTPS redirect, so the native side has to claim your domain before the first sign-in.

    Android checklist: the HTTPS redirect registered in Authentication, Security and sessions, the App Link, the redirect activity and native passkeys. The Android redirect and passkeys section has the exact entries.

    iOS checklist: the same registered HTTPS redirect, the associated domains and native passkeys. The iOS redirect and passkeys section has the exact entries.

  6. Rebuild the app, sign in and register a passkey. Rebuild so the module and the platform configuration are both in the binary. An Expo project needs a development build at this point, because Expo Go cannot load the native module. Then create the instance once, call signIn(), and call registerPasskey() as soon as the session resolves, while it is at most five minutes old. currentSession() answers from a 30-second cache; pass { force: true } when you need our live answer.

  7. Verify the token on your backend. Send the result of getToken() as a Bearer token. On every protected request, your backend verifies the ES256 signature against the issuer's JWKS at <origin>/.well-known/jwks.json, then iss, aud, exp and typ: at+jwt. Reject a token whose act is not null unless the route accepts agent access. Use a server SDK or any JWT library. Call getToken() right before each request: after a refresh the previous access token stops working at GET session/ and DELETE session/. Client session flags control what the app displays; your backend checks the live session with GET session/ before sensitive actions.

Before a payout, a new bank account or a change of email or phone, ask for a step-up and act only on an approved result your backend reads itself.

const result = await auth.stepUp({ action: 'payout', amount: '900.00', currency: 'EUR' });
if (result.approved) {
  // Your backend confirms with GET step-up/{result.id}/ before it pays out.
}

Map the session fields and the errors

DiditSession fields and what to read them for
FieldWhat it holdsUse it for
userIdThe person's Didit user idYour own account record key
sessionIdThe current sessionSupport and audit lookups in the console
applicationIdThe application the session belongs toKeeping sandbox and live data apart
vendorDataThe id that ties the person to their verifications and transactionsJoining sign-in to KYC and monitoring results
email, emailVerified, phoneContact details and whether the email is verifiedConfirming which person is signed in
methodsThe methods this sign-in usedTelling a passkey sign-in from a password or email code sign-in
mfaVerified, verifiedTwo flags the session carriesWhat the app displays, never what the backend allows
organizationsThe organizations the person belongs toChoosing a workspace after sign-in
expiresAtWhen the session endsPrompting reauthentication before it happens

These fields drive the screens your app shows. They do not authorize anything on the server: the backend verifies the token and checks the live session before every sensitive action.

What the calls return when something goes wrong
ResultWhat it meansFix
cancelledThe person closed the hosted pageKeep them on your sign-in screen; no error copy is needed
browser_unavailableBelow iOS 17.4, hosted sign-in and step-up that needs to open a check return browser_unavailable. Session, token and sign-out calls are unaffectedRaise the deployment target to iOS 17.4 or later, or keep those people on a path without hosted sign-in
not_signed_inreauthenticate was called without a sessionSign in first, then reauthenticate
step_up_user_mismatchA different person signed in during reauthenticateThe new session is ended and the current one stays; ask the original person again
invalid_grant at the token exchangeThe code is unknown, used or expired, the verifier or redirect does not match, the redirect is no longer registered, or the person is blockedCheck redirect and verifier consistency, restart sign-in for an expired or used code, and read the token docs for the other causes
currentSession and getToken resolve with nullWe ended the session: revoked, expired or a reused refresh tokenTreat the person as signed out and send them to signIn

Test in the sandbox before you go live

Build against a sandbox application the whole time. Its sign-in origin is https://<slug>.sandbox.auth.didit.me, its keys are separate from live keys, and its publishable key starts with pk_test_. Sandbox testing is free and unlimited, so run the flow as often as you need.

  • Create the sandbox application, register the HTTPS redirect, and enable passkey.
  • Run a development build on an Android 9 or later device, and on iOS 17.4 or later so the hosted page can return to your redirect.
  • Sign in on the hosted page with a fresh session, then call registerPasskey() within five minutes and confirm that the call returns a passkey ID.
  • Confirm that registerPasskey() needs a fresh session after the five-minute window closes, then call reauthenticate() to sign the same person in again and retry from the new session.
  • Call signOut(), then signInWithPasskey(), and confirm you get a session with the same userId.
  • Confirm that your backend rejects an access token with an invalid signature. For a valid token, verify the ES256 signature against the sandbox issuer's JWKS, check iss against that issuer and aud against the sandbox application ID, require an unexpired exp and a typ header of at+jwt, and require act to be null unless the route accepts agent access.

Expected success: currentSession() resolves with a session that carries userId, vendorData, methods and expiresAt; registerPasskey() resolves with a passkey ID; getToken() resolves with a five-minute JWT that your backend accepts. Every sign-in and failure also appears on the person's timeline in the console, next to their verifications and transactions, and you can subscribe to the auth.* webhooks if your backend reacts to sign-ups and sign-ins.

Check that your HTTPS redirect exactly matches the URI registered in the console. If the app does not receive the callback, check the Android App Link and redirect activity or the iOS associated domains against the platform quickstart. A test device below Android 9 will not offer a passkey at all, even though the module itself supports API 24.

A session overview with its warnings in the Didit Business Console
The session a passkey sign-in creates, with its warnings, in the Didit Business Console.

Disconnect the integration

auth.signOut() signs the person out on the device at once, then ends the session at Didit when the device can reach it. After that, currentSession and getToken resolve with null, so your app reads the person as signed out.

To remove the integration from the project, delete the pod 'DiditSDK/Auth' line from ios/Podfile and run cd ios && pod install, remove @didit-protocol/auth-react-native from your dependencies, and remove the App Links and associated domains entries you added. On the Didit side, delete the redirect URI under Authentication, Security and sessions so no stale callback stays registered, and sign people out from the console if you are retiring the application.

Cost of both ends

What Didit charges

  • Authentication: the first 50,000 active users each month are free, then $0.02 per additional active user for that month.
  • Identity verification in the same app: billed separately at $0.33 per completed full ID check, made up of ID document $0.15, passive liveness $0.10, face match $0.05 and device and IP analysis $0.03.

What your team spends

Budget engineering time for native builds and redirect setup on the platforms you support. Test Android passkeys on Android 9 or later and the iOS hosted sign-in flow on iOS 17.4 or later. The sandbox costs nothing while you build.

Worked example

An app with 80,000 active users in a month, of whom 12,000 also complete a full ID check:

  • Authentication inside the free allowance: 50,000 active users x $0.00 = $0.00
  • Authentication above it: 80,000 - 50,000 = 30,000 active users x $0.02 = $600.00
  • Full ID checks, billed separately: 12,000 x $0.33 = $3,960.00
  • Total for the month at list price: $600.00 + $3,960.00 = $4,560.00

For 80,000 monthly active users, Authentication costs $600.00 at list price, and the optional ID checks add $3,960.00. Growth applies 4% off Didit prices and Scale 10%, and their monthly credit is applied to usage first. The figures above are list price with no credit applied. See didit.me/pricing for the current plan terms and the cost estimator.

Sources

Start with a sandbox application at business.didit.me. Open Authentication, register your HTTPS redirect, enable the passkey method, and run a development build of your app against it. No sales call is needed to test passkeys end to end.

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

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

Can I use Didit passkeys in Expo Go?

No. Expo Go cannot load the native Authentication module, so passkey sign-in needs a development build of your app. Follow the Android Maven or iOS CocoaPods or Swift Package Manager setup for your target platform. Configure Android App Links and the redirect activity or iOS associated domains, then rebuild the app.

What are the minimum versions for React Native, Android and iOS?

React Native 0.77 with the New Architecture, Android API 24 and iOS 15.0. Passkeys themselves need Android 9 or later, and the hosted pages need iOS 17.4 at run time. Below iOS 17.4, hosted sign-in and step-up that needs to open a check return browser_unavailable, while session, token and sign-out calls keep working.

How long do I have to register a passkey after signing in?

registerPasskey() needs a session that is at most five minutes old. Call it right after signIn() or signInWithPasskey() resolves. If the session is more than five minutes old, call reauthenticate() to sign the same person in again, then call registerPasskey() from the new session. Use { method: 'passkey' } only if a passkey is already available on the device.

Where are refresh tokens stored in a React Native app?

In the iOS Keychain or storage protected by the Android Keystore, depending on the platform. Refresh tokens never reach JavaScript. getToken() returns a five-minute access JWT or null, and the refresh token stays in protected native storage.

How much does passkey sign-in cost?

Sign-in is billed as Authentication usage: the first 50,000 active users each month are free, then $0.02 per additional active user for that month. If the same app also runs identity verification, those checks are billed separately at $0.33 per completed full ID check.

Do I need a custom URL scheme for the redirect?

No, and it will not work. We return the person to your app with an HTTPS redirect and accept no custom URL schemes. On Android that means an App Link with the redirect activity, and on iOS that means associated domains, both set up before the first sign-in.

How do I tell whether someone signed in with a passkey?

Read the methods field on the DiditSession. It lists the methods that sign-in used, so you can separate a passkey sign-in from a password, an email code or a social provider. currentSession() answers from a 30-second cache, so pass { force: true } when you need our live answer.

What happens when a session is revoked or expires?

A session we ended, whether revoked, expired or caught reusing a refresh token, reads as signed out: currentSession and getToken resolve with null. Treat that as a sign-out and send the person back to signIn. Your backend should also check GET session/ before sensitive actions rather than trusting an unexpired token.

Can the identity verification SDK and the auth package live in the same app?

Yes. @didit-protocol/auth-react-native and @didit-protocol/sdk-react-native pin the same native release 4.15.4, so one app can sign people in and verify them. Passkey sign-in and identity verification are billed separately.

What happens if a different person signs in during reauthentication?

reauthenticate() rejects with step_up_user_mismatch. We end that new session and keep the current one, so you can ask the original person to try again without losing their session.

Does the Android API 24 minimum mean passkeys work on Android 7?

No. The native module installs and runs from API 24, but passkeys need Android 9 or later. Test passkeys on a device at that level, and treat the older range as a sign-in path without passkeys.

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.