Skip to content
Constaia

Expo / React Native

Validate documents with AI in Expo / React Native

Capture the document with the camera in Expo and upload it to your server; the key never goes inside 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.

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

    A photo, screenshot or PDF. Say which document you expect and the rules: in date, less than 6 months old, in this person's name.

  2. 02

    We read, classify and check

    Text reading, AI classification and fixed checks: Spanish ID number check letter, machine readable zone, IBAN, dates and totals.

  3. 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 at the end unless it needs review.

And for the record…

Create your free account and validate your first document in five minutes. No card required.