← Back to Blog
Tutorial2 min read

Face Verification in React Native: Mobile Integration Guide

How to integrate face verification API into a React Native mobile app — capture selfies, compare with ID photos, and add liveness detection.

Why Face Verification on Mobile?

Mobile apps are the primary channel for KYC onboarding, banking, and identity verification. React Native lets you build cross-platform apps that call the ARSA Face Recognition API directly.

Setup

Since ARSA is a REST API, no native SDK is needed — just use fetch:

javascript
const API_KEY = "your-api-key";

const BASE_URL = "https://faceapi.arsa.technology/api/v1";

Capture a Selfie

Use expo-camera or react-native-camera:

javascript
import { Camera } from 'expo-camera';

const takeSelfie = async (cameraRef) => {

const photo = await cameraRef.current.takePictureAsync({

quality: 0.8,

base64: false,

});

return photo.uri;

};

Verify Against ID Photo

javascript
const verifyIdentity = async (selfieUri, idPhotoUri) => {

const formData = new FormData();

formData.append("image1", {

uri: selfieUri, type: "image/jpeg", name: "selfie.jpg"

});

formData.append("image2", {

uri: idPhotoUri, type: "image/jpeg", name: "id.jpg"

});

const response = await fetch(

${BASE_URL}/face_recognition/validate_faces,

{

method: "POST",

headers: { "x-key-secret": API_KEY },

body: formData,

}

);

const result = await response.json();

return {

match: result.match_result,

similarity: result.similarity_score,

isRealFace: result.face1_analysis?.passive_liveness?.is_real_face,

age: result.face1_analysis?.age,

};

};

Face Analytics on Mobile

javascript
const analyzeFace = async (photoUri) => {

const formData = new FormData();

formData.append("face_image", {

uri: photoUri, type: "image/jpeg", name: "photo.jpg"

});

const response = await fetch(

${BASE_URL}/face_analytics,

{

method: "POST",

headers: { "x-key-secret": API_KEY },

body: formData,

}

);

return response.json();

};

Tips for Mobile

  • • Compress images before uploading (quality 0.7-0.8)
  • • Check liveness on every verification
  • • Handle network errors gracefully
  • • Store the API key securely (not in source code)
  • For web integration, see our JavaScript face detection guide.

    Get started free or view the docs.

    Ready to get started?

    Try ARSA Face Recognition API free with 100 API calls/month.

    Start Free Trial