Skip to main content
The person picks the file or takes the photos on your site, Rial says whether they are real, and your secret key never reaches the browser. No dependencies, under 10 KB gzipped.
The origin of your page (for example https://claims.example.com) must be in your account’s allowed origins. Ask Rial to add it. Until it is there the browser blocks the audit, and a live capture never tells your page it finished.
Without a bundler, load it with a <script>:

Audit a photo

1. Your backend mints a one-time token:
2. Your page uploads the photo with it:
3. Your backend decides. result is for your UI only: the browser is in the user’s hands, so whatever it reports back can be forged. Read the verdict in your backend with rial.verifications.get(id), or by webhook if you passed webhookUrl to prepare.
  • A token is good for one file and expires after an hour (expiresInSeconds in prepare).
  • audit takes a File, Blob or Uint8Array: JPEG, PNG, WebP, HEIC or HEIF, up to 20 MB.
  • It waits up to 60 seconds for the verdict (timeoutMs) and accepts an AbortSignal.
  • To keep the verdict out of the browser, prepare the audit with exposeResult: false. The page then gets { id, status, verdictWithheld: true }.

Live capture

The person takes the photos with their camera in a modal over your site, and your page learns when they are done. The verdict goes to your backend, never to the page. 1. Your backend creates the verification:
2. Your page opens the capture with it:
3. Your backend reads the verdict with rial.verifications.get(verificationId), or by webhook.
  • On a phone the capture fills the screen. On a computer the modal shows a QR, the person finishes on their phone, and open resolves then.
  • onEvent gets ready, started, camera_denied, step_completed, submitted, completed, error and close_requested.
  • If the person closes the modal first, open rejects with closed. The verification stays open until it expires, so you can open it again.
  • One capture at a time per page.

What your page needs

  • https (localhost is fine), and <meta name="viewport" content="width=device-width, initial-scale=1">.
  • If you send a Content-Security-Policy: frame-src must allow https://verify.rial.io (and https://sandbox.verify.rial.io for the sandbox).
  • If you send a Permissions-Policy: camera=(self "https://verify.rial.io"), and the same for microphone, geolocation, accelerometer and gyroscope if your steps use them.

Redirect instead of the modal

Some in-app browsers and Android WebViews never give an iframe the camera. For those, send the person to the capture page:
redirect does not return a result, and coming back to your site afterwards is not supported yet. Read the outcome in your backend.

Errors

Every failure is a RialError with code, step, status and, for most codes, a hint that says what to check.

Sandbox

Mint and upload against the same environment. See Sandbox. The bundled types need TypeScript 5.7 or newer.