MainSDK
Search⌘K
Integrations

Persona

Use Persona for MainSDK identity checks with configurable flows - API key, main.yaml per market, sandbox testing and swapping.

1 interface1 driverWritten guide
Updated 2026-10-28

Persona runs identity verification flows you configure, such as a government ID check with a selfie. Behind verify, it runs verify.identity() in the markets you route to it. Pick it when you want to shape the verification steps per use case without changing app code.

Interfaces it serves

Pick Persona in main.yaml for any of these. Your calls stay the same, and you can swap later.

Before you start

  1. Get a Persona account. It has a sandbox and a production environment.
  2. Build an inquiry template for the checks your flow needs.
  3. Create an API key for each environment and keep it in your secrets manager.

Configure

main.yaml
verify:
  driver: twilio-verify      # phone and email checks
  identity: { us: persona }  # market to identity driver
  require: { us: high }      # persona reaches high
  drivers:
    persona:
      key: secret:PERSONA_API_KEY   # the API key of the environment
      template: itmpl_123           # the inquiry template that runs the checks

Use it

lib/kyc.ts
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;   // Persona's one-time link; later verify.identity.complete({ id: started.id })
}

Local development and testing

Use Persona's sandbox with a sandbox key. 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 verify driver (spec verify). It declares its own host, withpersona.com, so network.allow does not change.
  • Persona reaches the high level; the template you name decides which checks run.
  • Identity results are personal data; label the fields that store them in db.

Swap to or from it

main.yaml
verify:
  identity: { us: onfido }   # was { us: persona }

Results you keep live in your own db. Inquiries already run stay in Persona.

FAQ

Can I use Persona in one market and DigiLocker in India? Yes. Route each market in identity, for example { us: persona, in: digilocker }.

Next

Was this page helpful?

↑↓ moveEnter openEsc close

Not decided yet