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.
Parameter | Type | Description |
---|---|---|
inquiryId | String | ID 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.
Parameter | Type | Description |
---|---|---|
inquiryId | String | ID 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.
Parameter | Type | Description |
---|---|---|
eventName | String | A string representing the event that has just occurred in the Persona flow. |
metadata | Object | An 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:
start | The individual has begun progressing through the flow. |
country-select | The individual confirmed the country of their ID. |
verification-select | The individual selected a verification to begin. |
verification-change | The status of an in-progress verification changed. |
document-camera-select | The individual is opening the camera for the government ID verification. |
document-camera-capture | The individual took a photo for the government ID verification. |
document-upload | The individual uploaded a government ID photo. |
selfie-record-upload | The individual uploaded a selfie photo. We allow uploads when their browser does not support embedded video. |
one-time-link-sent | The individual sent a one time link to their mobile device. |
one-time-link-start | The individual resumed their flow on their mobile device using a one-time link. |
one-time-link-exit | The individual returned to their initial device after sending a link to their mobile device. |
success | The individual has been successfully verified. |
complete | The individual is exiting the flow after verifying their identity. |
Updated about 4 years ago