CredflareDevelopersOpen dashboard
Preview

Collect evidence inside your app

Your server opens a short-lived session for a case. The SDK uses it to show the applicant what to send, ask your questions, guide each photo or file, run the liveness challenge and location step, confirm an email address or phone number, and submit the evidence.

The SDKs are in preview. They are not published to npm, pub.dev, Swift Package Manager registries or Maven. Add them from source on GitHub: JavaScript, React Native, Flutter, Swift and Kotlin. Session endpoints are not yet available on the production API, so build against a development environment until they are announced.
Not yet on production: questions with show_if, email and phone codes, fetching the session after a submit, rejection screens with a help contact, and continuing on a phone. They need API and SDK versions that are not released yet.

How a session flows

Your server creates a case and a session with Credflare, passes the session to your app, and later reads the decision. Your server Client ID and secret Credflare API Case and session Your app + SDK Session token only 1. create 2. session 3. collect 4. Your server reads the decision with its own credentials.
  1. Your server creates a case for one of your profiles with POST /client/verifications, as in your first request. The profile decides what the applicant must provide.
  2. Your server calls POST /client/verifications/{id}/sessions and returns the session descriptor to the signed-in applicant: session_id, token, api_base_url and expires_at.
  3. Your app hands that descriptor to the SDK through a sessionProvider callback. The SDK loads the outstanding requirements, asks the questions, collects each document, then runs the facial, location, email and phone requirements in profile order. After every submission it loads the session again, so a requirement a workflow adds during the case is collected too.
  4. Your server retrieves the outcome with GET /client/verifications/{id}. Never grant access because the app reported a submission.

A session lasts at most 30 minutes and never longer than its case. Only a hash of its token is stored. Treat the descriptor as a temporary credential: keep it out of logs and persistent storage, and never put client credentials in an app.

What the applicant sees

The guided flow in the React Native, Flutter, Swift and Kotlin SDKs leads with your name and message. Credflare appears only as a small footer. Screens follow light and dark mode.

Start. Nothing loads until the applicant chooses to begin.
Start. Nothing loads until the applicant chooses to begin.
Requested documents, with your name and message first.
Requested documents, with your name and message first.
One side at a time, with the capture method and progress.
One side at a time, with the capture method and progress.
Receipt. It confirms collection, not a decision.
Receipt. It confirms collection, not a decision.

Rendered from the Flutter SDK for a sample profile that asks for camera photos of an ID card and a saved bank statement. React Native uses the same layout and copy. Sandbox sessions carry a Test mode label. The liveness and location screens are shown in Liveness and location.

Requirements come from the profile

The SDK has no settings for which documents to collect or how. You decide that in the profile the case was created with. The SDK reads the outstanding requirements from the session and renders them.

Set in the profileThe SDK shows
Documents and their groupsA Required list, and Provide one of these for groups of alternatives.
Capture method for each documentCamera steps, file steps or both, for every requested side.
Requested sidesOne step per side, with a front or back guide.
Workspace file types and size limitThe accepted formats and maximum size.
Your workspace name, logo and request messageThe header and the message above the document list.
A facial requirement and its settingsA liveness challenge with the server's gestures, an optional video, then a selfie.
A location requirement and its settingsA location step that names your reference places by label.
Questions in form_schemaA form that shows each question when its show_if matches the answers so far.
An email or phone requirementA step that sends a code and asks the applicant to type it.

A case keeps the requirements it was created with, so editing a profile changes new cases only. The server checks every upload against those requirements, whatever the app sends.

What a receipt means

A receipt confirms that Credflare received the evidence. It is not a verification decision. Camera source is reported by the device, so it is not proof of a live person or an untampered camera feed. A completed liveness challenge shows that the camera recorded the server's gesture sequence in time; read what the checks show.

Capability in the session responseCurrent value
capabilities.trusted_camerafalse
capabilities.liveness"challenge"
capabilities.deepfake_detectionfalse

Session endpoints

The SDK clients call these for you. Each request sends Authorization: Bearer <session token>.

Method and pathPurpose
GET /sdk/sessions/{session}Outstanding requirements, upload limits and your branding.
POST /sdk/sessions/{session}/uploads/documentsMultipart document file with side, capture_source and document_type_id.
POST /sdk/sessions/{session}/liveness-challengesIssue a liveness challenge with the gestures to run.
POST /sdk/sessions/{session}/uploads/biometricsMultipart gesture frame, liveness video or selfie, with type, challenge_id and capture_source=camera.
POST /sdk/sessions/{session}/submitSubmit a document with an evidence list of file_id, side and source, a facial_verification with its challenge_id, or a location_verification.
POST /sdk/sessions/{session}/{channel}-codesSend an email or phone code. channel is email or phone.
POST /sdk/sessions/{session}/{channel}-codes/confirmConfirm the code.
POST /sdk/sessions/{session}/handoffCreate a link that continues the session on a phone.
DELETE /sdk/sessions/{session}Revoke the session. The case stays open.

Send a UUID X-Idempotency-Key with every upload and submission. Reuse it when retrying the same payload after a network failure; use a new one when the applicant changes the evidence. Only successful responses are replayed, and reusing a key with different data returns 409. See request keys and retries.

Handle errors

StatusMeaningWhat to do
401The session expired or was revoked.Ask your backend whether to issue a replacement session for the same case.
409The case no longer accepts submissions, or a request key was reused with different data.Stop collecting. When the session fetch after a submit returns it, show the receipt. For a key conflict, send the new data with a new key.
422The evidence does not meet the requirement.Match on code when it is present and show its rejection screen. Otherwise show the message and let the applicant try again.

After a submit

A workflow can add a requirement while the case is open, for example a phone check when an answer says the applicant lives in Germany. The session always returns what is still outstanding, so the SDKs never decide from their own list. After each submit, email_code_confirm and phone_code_confirm, they fetch the session again:

  1. When status is pending or in_progress and any of profile.document_requirements, profile.verification_requirements, profile.form_schema is not empty, continue with the next outstanding step.
  2. Otherwise show the receipt.
  3. When the fetch returns 409, the case is closed (completed, rejected or expired) and accepts nothing more, for example because a workflow approved it after the last step. Show the receipt.

When the fetch fails in any other way, the SDKs show "We could not check what is still needed. Try again." with a retry, never the receipt.

Rejection screens

Every 422 with a code shows a screen from the rejection map in the SDK spec: a title, a message, who asked for the evidence, a help line and one button. The codes and their copy are listed in liveness and location rejections and code rejections. A 422 without a code, or with a code the SDK does not know, shows the server message with Try again.

ActionButtonWhat it does
retryTry againStay on the step and capture again with the same settings.
restartStart againStart the step from the beginning, which asks the server for a new challenge.
reenter_codeEnter the code againClear the code field and let the applicant type the code again.
new_codeSend a new codeRequest a new code for the same email address or phone number.
waitSend a new codeKeep the code screen and enable sending a new code at resend_available_at from the rejection, or from the last code request when the rejection has none.
leaveCloseNothing can be done in the app now; show the help line and let the applicant leave.

After a leave rejection, such as phone.not_configured or phone.send_limit, the flow ends with a host action result that carries the code, never with a cancellation. Use the code to tell the applicant what to do next, such as confirming the number another way or trying again tomorrow.

SDKHow your app gets the code
JavaScriptonLeave(code)
React NativeonHostActionRequired({code}), before onClose
FlutteronHostActionRequired(code), before onClose
Swift.hostActionRequired(code:)
KotlinVerificationOutcome.rejectionCode from launchWithOutcome

Help contact

requester in the session, and in the hosted page's public payload, has name, logo_url, help_email and help_url. Both help fields come from your workspace's default brand (its email and website), else from your organization's email and website. A website stored without a scheme is returned with https://, and anything that is not an http or https URL is left out. A field is null when nothing is stored, and requester is null when the case has no requester name.

{
  "requester": {
    "name": "Ada's Workspace",
    "logo_url": null,
    "help_email": "[email protected]",
    "help_url": "https://northwind.example/support"
  }
}
The session hasThe help line says
help_emailIf you need help, contact {verifier} at {help_email}. The address is a mailto: link.
Only help_urlIf you need help, visit {help_url}. The link opens outside the flow.
Neither, or no requesterIf you need help, contact {verifier}.

{verifier} is requester.name, or "your verifier" when requester is null. Every rejection screen also says "Requested by {verifier}."

Continue on a phone

The JavaScript SDK and the hosted page can show a QR code so an applicant who started on a computer can finish with the phone camera. The native SDKs do not offer it.

  1. The browser calls POST /sdk/sessions/{session}/handoff, or POST /client/verifications/{id}/handoff on the hosted page. The reply is 201 with handoff_url and expires_at.
  2. It shows handoff_url as a QR code with the minutes left, and a new code once it expires.
  3. The phone opens the hosted page, which reads the token from the URL fragment, removes it from the address bar and calls POST /verification-handoffs/redeem with {"token": "..."}. The reply is a session descriptor for the same case, with the same outstanding requirements.
  4. The first device keeps its own session and fetches it to show the receipt once the phone has finished.

Platform support

SDKMinimumFace signalsMock locationPermissions
JavaScriptA browser with camera and geolocation access, over HTTPSMediaPipe Face LandmarkerNot detectable, sent as nullCamera and location
React NativeReact Native 0.88.1Apple Vision on iOS, ML Kit on AndroidAndroid only, null on iOSCamera, photo library and location
FlutterFlutter 3.41, iOS 15Apple Vision on iOS, ML Kit on AndroidAndroid and iOSCamera, photo library and location
SwiftiOS 16Apple VisioniOSCamera and location
KotlinAndroid 7.0 (API 24)ML KitAndroidCamera and location

No SDK needs microphone access: the liveness video has no sound.

Choose a platform