Skip to content
Constaia

React

Validate documents with AI in React

The <constaia-upload> widget has a React wrapper: phone camera, quality check and upload to your backend.

Install

npm i @constaia/widget

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
DocumentUpload.tsx
import { ConstaiaUpload } from "@constaia/widget/react";

export function DocumentUpload() {
  return (
    <ConstaiaUpload
      endpoint="/api/verify" // your backend: the secret key never reaches the browser
      document="es_dni"
      lang="es"
      onResult={(analysis) => console.log(analysis.verdict?.status)}
    />
  );
}

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

    OCR, AI classification and deterministic validators: PDF417 barcodes, MRZ, ABA routing numbers, 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.