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.
Installation
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 result. If you do not have a server, use the widget with a publishable key.
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.
- 01
Send the document and what you expect
A photo, screenshot or PDF. Tell us which document you expect and the rules it must meet: not expired, issued in the last 60 days, in this person's name.
- 02
We read, classify and check
Text reading, AI classification and fixed checks: PDF417 barcodes, machine-readable zones, ABA routing numbers, dates and totals.
- 03
Get the verdict and the file is deleted
Valid, invalid or review, with the reasons in your language. By default, the file is deleted when the analysis ends unless it needs review.
And for the record…
Create your free account and validate your first document in five minutes. No credit card required.