RideKit
Docs/Reference/Driver selfie check before going online

Driver selfie check before going online

Built: 2026-11-02. For the operator, and for whoever maintains the code.

Saudi Arabia's Transport General Authority requires facial verification of the captain (2026). The person driving must be the person whose documents were approved, not a relative or someone renting the account. Uber's Real-Time ID Check and Careem's selfie check work the same way.

What the driver sees

  1. They tap Go online. If a selfie is due, the app says "Take a selfie to confirm it's you before going online" and opens Confirm it's you.

  2. Take selfie opens the front camera. A gallery photo cannot be used.

  3. Send selfie. The selfie is compared with the driver's approved profile photo:

    Result What the driver reads Can they drive?
    Matched "Thanks, that's you. You can go online now." Yes, for the next 24 hours
    Below the match needed "This didn't match your profile photo…" No, they take another
    No face found "We couldn't see a face…" No, they take another
    Could not compare "Sent for review. You can drive meanwhile." Yes, unless the market says wait
    Rejected by a reviewer "Your last selfie was rejected. Take a new one." No

    A selfie cannot be compared when there is no approved profile photo, no face service is set up, or the service failed. At most 5 selfies can be sent in 15 minutes, because each comparison is paid for.

What the operator does

  • Admin → Providers → AWS Rekognition. Enter the access key, secret and region. The region decides where selfies are processed, which is a Saudi PDPL data-transfer question, so there is no default. Without these keys, every selfie waits for a person.

  • Admin → Face checks (People). Selfies waiting for review, or that did not match, appear here. The reviewer sees the selfie and the profile photo side by side:

    • It's the driver approves the selfie.
    • Not the driver rejects it, with a note the driver reads in the app.
  • Admin → Markets → KYC → Selfie check before driving.

    Setting Default Meaning
    Ask every (hours) SA 24, elsewhere blank (off) A selfie is due when the last good one is older than this
    Match needed (%) 90 Similarity a selfie needs to pass on its own
    Keep selfies (days) 30 After this the image is deleted (03:00 daily); the result stays
    A selfie waiting for review does not stop the driver On Off: the driver waits for the reviewer

Legal check needed. The TGA's exact frequency and method (for example, liveness or a government-run check) and the PDPL retention period should be confirmed with local counsel before launch. All four values are settings.

For developers

Piece Where
Rules, decision, gate backend/src/drivers/face-check.ts (faceCheckConfigFor, decide, faceCheckBlock)
Service drivers/face-check.service.ts: assertCanGoOnline (called in DriversService.goOnline), submit, queue, photos, review, purgeOld (cron)
Face service drivers/face-match.provider.ts: Rekognition CompareFaces over common/aws-sigv4.ts, with no SDK. SigV4 is checked against AWS's post-vanilla test vector.
API GET/POST /driver/face-check; GET /admin/face-checks?status=review|failed|all; GET /admin/face-checks/:id/photos; POST /admin/face-checks/:id/review; GET /admin/drivers/:id/face-checks
Data driver_face_checks (migration 122). The image is stored privately under drivers/<id>/face/.
Driver app app/(app)/face-check.tsx. home.tsx opens it on face_check_required.
Admin app/(dashboard)/face-checks/page.tsx, components/markets/FaceCheckCard.tsx
Tests drivers/face-check.spec.ts

Tested end to end with the install switched to Saudi Arabia, and no AWS keys set:

  • Android emulator:
    • Go online was refused and the selfie screen opened.
    • A front-camera selfie went to review ("You can drive meanwhile"), and the driver then went online.
    • After a reviewer rejected it, Go online showed "Your last selfie was rejected".
  • Chrome, admin:
    • the Face checks nav entry and queue row;
    • the selfie shown beside "No photo";
    • reject refused without a note, then rejected with one;
    • the SA market card showing 24 hours and 90%.
  • API:
    • with "wait for review" on, a selfie under review blocked going online (reviewing);
    • a PDF was refused.
  • Purge: the purge job deleted a selfie backdated by 40 days and kept its result.
  • iOS simulator: the screen renders. The simulator has no camera, so the selfie itself was taken on Android.

Not tested live: a real Rekognition comparison, which needs AWS keys. The adapter's request and its parsing of matches, no-face results and errors are covered by unit tests.

In this dev setup, admin image links point to localhost:3000/files because S3_PUBLIC_URL is unset and the API runs on port 3100. A deployment sets S3_PUBLIC_URL, or uses S3.

source: docs/driver-face-check.md (ships identically in the product zip)