CredflareDevelopersOpen dashboard
Preview

React Native SDK

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

Not published yet. The source is on GitHub at credflare/react-native-sdk. The package name will be @credflare/sdk-react-native. It targets React Native 0.88.1 with React 19.3.0 and depends on the JavaScript SDK.

Add the guided flow

import {CredflareVerification} from '@credflare/sdk-react-native';

async function sessionProvider() {
  const response = await fetch('https://api.your-app.example/credflare/session', {
    method: 'POST',
    headers: {Authorization: 'Bearer ' + userToken},
  });
  return response.json(); // {session_id, token, api_base_url, expires_at}
}

<CredflareVerification
  sessionProvider={sessionProvider}
  onClose={() => navigation.goBack()}
  onSubmitted={info => refreshStatus()}
/>

sessionProvider calls your own authenticated backend, which creates the session as shown in the server example. The applicant presses Start and never sees a session ID or token.

PropPurpose
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 {code} before onClose when nothing more can be done in the app: a leave rejection passes its code, and a receipt that leaves founders questions or other checks to your app passes null.
autoStartSkips the Start screen and loads the session at once.
faceProviderReplaces the face signal provider, for example in tests. It takes the same NativeFaceProvider shape as nativeFaceProvider.
locatorReplaces the native location source.

The flow asks the questions, collects the documents, then runs the case's facial, location, email and phone requirements in profile order, and ends with a receipt that lists what was received. Founders questions and other checks stay with your app, and the receipt tells the applicant so.

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

For a custom layout, use useCredflareSession(provider) to load the session and CredflareDocumentCapture for one document. The capture component keeps upload IDs and retry keys after a failed send, so keep it mounted while the applicant retries.

<CredflareDocumentCapture
  session={session}
  requirement={requirement}
  requesterName={info.requester?.name}
  maxFileSizeBytes={info.upload_limits.max_file_size_bytes}
  allowedFileTypes={info.upload_limits.allowed_file_types}
  onSubmitted={submissionId => reloadRequirements()}
  onDirtyChanged={hasUnsentFiles => setGuardLeave(hasUnsentFiles)}
/>

Configure the app

Add these as direct dependencies of your app so their native modules are linked, then run pod installation for iOS.

PackageVersionUsed for
react-native-image-picker8.3.0Document photos
@react-native-documents/picker12.1.0Saved files
react-native-get-random-values2.1.0Request keys
react-native-vision-camera5.2.4Liveness preview, gesture frames, video and selfie
react-native-nitro-modules0.37.2Required by the camera packages
react-native-nitro-image0.15.2Required by the camera
react-native-vision-camera-face-detector2.1.0ML Kit face signals on Android
react-native-geolocation-service5.3.1Location fixes
react-native-svg15.16.1Icons
module.exports = {
  dependencies: {
    'react-native-vision-camera-face-detector': { platforms: { ios: null } },
  },
};

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