Events & Callbacks
Handle verification events and callbacks to create a responsive user experience.
Event Overview
The Owl Eyes SDK emits events at key points during the verification process, allowing you to respond to user actions and verification status changes.
| Event | Description | When Triggered |
|---|---|---|
ready | SDK is initialized and ready | After SDK loads |
started | Verification flow started | User begins verification |
stepChange | User navigated to new step | Each step transition |
stepCompleted | User completed a step | After each step |
completed | Verification completed | Final result received |
error | An error occurred | On any error |
close | User closed the flow | User exits early |
Registering Event Handlers
Register event handlers using the on method:
Callback-Style Registration
Alternatively, pass callbacks when calling start():
Event Data Reference
ready Event
started Event
stepChange Event
stepCompleted Event
completed Event
error Event
close Event
Removing Event Handlers
Use off to remove event handlers:
React Event Handling
In React, handle events through component props or the hook:
Analytics Integration
Use events to track verification funnel analytics:
Best Practices
Always handle errors
Provide clear feedback to users when errors occur and offer retry options when possible.
Don't trust client-side completion events
Always verify results on your backend via webhooks. Use client events only for UI updates.
Track abandonment
Use the
closeevent to understand where users drop off.Clean up handlers
Remove event handlers when components unmount to prevent memory leaks.