Client Callbacks

onStart

The onStart callback is called when the individual has clicked on the first "Start verifying" button. It takes a single argument of the inquiry ID.

ParameterTypeDescription
inquiryIdStringID of the inquiry used in this instance of the flow.

onComplete

The onComplete callback is called when the inquiry's status has transitioned to completed and the individual clicks on the "Done" button to close the flow. It takes a single argument of the inquiry ID.

ParameterTypeDescription
inquiryIdStringID of the inquiry used in this instance of the flow.

onLoad

The onLoad callback is called when the iframe finishes loading and is ready to be displayed. It does not take any arguments.

onExit

The onExit callback is called when an individual exits the inquiry flow. It does not take any arguments.

onEvent

The onEvent callback is called at certain points in the Persona flow. It takes two arguments, an eventName string and a metadata object.

🚧

Do not use this for critical flows

onEvent exists for analytics purposes but the events passed through are potentially lossy. If your business logic depends on granular verification and inquiry status changes, we recommend using Webhooks.

ParameterTypeDescription
eventNameStringA string representing the event that has just occurred in the Persona flow.
metadataObjectAn object containing information about the event.

Example metadata for a verification status change event:

{
  "id": "ver_rMkwDnyoZy6b1jDSofjUtL5z",
  "status": "<submitted|passed|failed>"
}

Other supported events include:

startThe individual has begun progressing through the flow.
country-selectThe individual confirmed the country of their ID.
verification-selectThe individual selected a verification to begin.
verification-changeThe status of an in-progress verification changed.
document-camera-selectThe individual is opening the camera for the government ID verification.
document-camera-captureThe individual took a photo for the government ID verification.
document-uploadThe individual uploaded a government ID photo.
selfie-record-uploadThe individual uploaded a selfie photo. We allow uploads when their browser does not support embedded video.
one-time-link-sentThe individual sent a one time link to their mobile device.
one-time-link-startThe individual resumed their flow on their mobile device using a one-time link.
one-time-link-exitThe individual returned to their initial device after sending a link to their mobile device.
successThe individual has been successfully verified.
completeThe individual is exiting the flow after verifying their identity.