Skip to main content
This recipe shows how to issue a verifiable KYC credential the moment your identity provider confirms a user, using direct issuance. The user does not need an active session.

What you’ll build

  1. A webhook handler that fires when your KYC provider confirms a user.
  2. A Partner JWT signed with the issue scope. The JWT for initialize-user also carries the recipient’s email.
  3. A call to initialize-user to resolve the recipient’s DID, encryption public key, and signing public key.
  4. Issuance: build the VC bound to the holder’s signing key, sign it with issuer keys, encrypt it to the holder, and store it in DStorage.

Prerequisites

  • A published issuance program with a schema that includes KYC fields (e.g. kycVerified, kycLevel, verifiedAt)
  • Partner JWT signing configured (RS256 or ES256)
  • Issuer signing keys available to your backend

Step 1: Handle the KYC webhook

When your KYC provider (Sumsub, Onfido, Jumio, etc.) sends a verification-complete callback, extract the user email and verification result.

Step 2: Sign a Partner JWT

Generate a short-lived JWT with scope: "issue". For the initialize-user call, add the recipient’s email claim; the JWT for dstorage/vcs does not carry one.
The recipient’s email (the email claim sent to initialize-user) is the routing key that determines which AIR Account the credential lands in. Resolve it from the triggering event, and never reuse a partner, service, admin, or static email across recipients — every credential issued against that email lands in the same account.

Step 3: Resolve the user and issue

Resolve the recipient’s AIR Account with initialize-user, then build, sign, encrypt, and store the credential. buildVc, signVc, and encryptToHolder are issuer-controlled helpers backed by your signing keys.
Issuance typically completes in ~1–4 seconds. Record the returned storagePath as your issuance result; the credential is immediately available for the holder to present to any AIR verifier.

Next steps