Skip to content
Constaia

Expo / React Native

Validate documents with AI in Expo / React Native

Capture with the camera in Expo and upload to your backend with FormData; the key never ships in the app.

Install

npx expo install expo-image-picker

The safe pattern

The browser or app never sees your secret key. The file goes to your server, your server calls Constaia and returns the verdict.

Full guide
verify.ts
import * as ImagePicker from "expo-image-picker";

export async function pickAndVerify() {
  const result = await ImagePicker.launchCameraAsync({ quality: 0.8 });
  if (result.canceled) return null;
  const asset = result.assets[0];

  const body = new FormData();
  // React Native FormData accepts { uri, name, type }
  body.append("file", { uri: asset.uri, name: "dni.jpg", type: "image/jpeg" } as never);

  // Your backend calls Constaia: never ship the key inside the app
  const res = await fetch("https://tu-backend.example/api/verify", { method: "POST", body });
  return (await res.json()) as { status: "valid" | "invalid" | "review" };
}

One call. An answer you can act on.

  1. 01

    Send the document and what you expect

    Photo, screenshot or PDF. Set the expected type and the rules: not expired, under 6 months old, in this person's name.

  2. 02

    We read, classify and check

    European OCR, AI classification and deterministic validators: NIF letter, MRZ, IBAN, dates and totals.

  3. 03

    Get the verdict and delete the file

    valid, invalid or review with reasons in your language. By default the file is deleted when the analysis ends.

And for the record…

Create your account, copy the test key and validate your first document in five minutes.