Integrating Persona
How do I drive KYC Manually?
Learn how you can drive the Persona KYC flow manually
Here is an overview of how to integrate the Persona SDK embedded flow:
- Documentation: https://docs.withpersona.com/docs/quickstart-embedded-flow
- Pass the persona_inquiry_id to the Persona SDK
- The language here must be one of: [https://docs.withpersona.com/docs/languages](The language here must be one of: https://docs.withpersona.com/docs/languages)
- Subscribe to event handling callbacks. Documentation: [https://docs.withpersona.com/docs/embedded-flow-event-handling](Subscribe to event handling callbacks. Documentation: https://docs.withpersona.com/docs/embedded-flow-event-handling)
- Just because the Persona flow has completed it doesn’t mean that your customer is verified. It may take a period of time for additional handling in the customer verification process to complete in the Cybrid platform. You can poll on GET /api/customer/{ customer_guid } for the state
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Client</title>
<!-- Add this script tag to import Persona JavaScript library -->
<script src="https://cdn.withpersona.com/dist/persona-v4.9.0.js"></script>
</head>
<body></body>
<script>
let client = new Persona.Client({
inquiryId: { persona_inquiry_id },
language: { language },
onReady: () => client.open(),
onEvent: (eventName, metaData) => {
console.log(`Event: ${eventName}`);
},
onComplete: ({ inquiryId, status, fields }) => {
console.log(`Submitted: ${inquiryId}`);
},
onCancel: (inquiryId, sessionToken) =>
console.log(`Cancelled inquiry: ${inquiryId}`),
onError: (status, code) => {
console.log(`Error: ${status}`);
}
});
</script>
</html>
Updated about 1 month ago