Onfido
Use Onfido for MainSDK document and biometric identity checks - API token, main.yaml per market, testing and swapping.
Onfido verifies a person's identity from a photo of their identity document and a selfie or video. Behind verify, it runs verify.identity() in the markets you route to it. Pick it for regulated flows, such as onboarding to financial services, where you need a document-based identity check across many countries.
Interfaces it serves
Pick Onfido in main.yaml for any of these. Your calls stay the same, and you can swap later.
verifyBuilding for 0.7Driver onfido Onfido
identity
verify:
driver: onfidoSwap to another provider
Before you start
- Get an Onfido account and a sandbox to build against.
- Pick the regional environment that matches where your users' data must live, since Onfido runs separate regions.
- Create an API token for each environment and keep it in your secrets manager.
Configure
verify:
driver: twilio-verify # phone and email checks
identity: { us: onfido, default: onfido } # market to identity driver; default serves the rest
require: { us: high } # the level the market requires; onfido reaches high
drivers:
onfido:
token: secret:ONFIDO_TOKEN # the API token of the environment
workflow: wf_123 # the Studio workflow that runs document and selfie
region: eu # eu, us or in; picks api.<region>.onfido.comUse it
import { verify } from "mainsdk/verify";
export async function startCheck(user: string) {
const started = await verify.identity({
level: "high",
market: "us",
claims: ["age_over_18"],
purpose: "Open an account",
user,
consent: { policy: "privacy-2026-10" },
});
return started.url; // send the person to Onfido; later verify.identity.complete({ id: started.id })
}Local development and testing
Use Onfido's sandbox with a sandbox token. In tests, set verify.identity.default: local: the local fake approves with code: "approve" and keeps nothing but the asked claims.
What MainSDK adds on top
One call for identity checks in every market, routed by identity, and swappable with no code change. Only the claims you ask for are kept, each labelled, with a consent record; a level the driver cannot reach fails with MAIN-VERIFY-0004 before the person is sent anywhere.
See Phone, email and identity checks.
Limits and notes
- Built
verifydriver (specverify). It declares its own host,api.<region>.onfido.com, sonetwork.allowdoes not change. - Onfido reaches the
highlevel. - Identity results are personal data; label the fields that store them in
db. verifyis free and runs in your app.
Swap to or from it
verify:
identity: { us: persona } # was { us: onfido }Results you keep live in your own db. Checks in progress at Onfido stay there.
FAQ
Does Onfido store the document images? Onfido processes them under its own terms; check its data retention settings for your account.
Next
Was this page helpful?