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.

EventDescriptionWhen Triggered
readySDK is initialized and readyAfter SDK loads
startedVerification flow startedUser begins verification
stepChangeUser navigated to new stepEach step transition
stepCompletedUser completed a stepAfter each step
completedVerification completedFinal result received
errorAn error occurredOn any error
closeUser closed the flowUser exits early

Registering Event Handlers

Register event handlers using the on method:

events.jsjavascript
Loading...

Callback-Style Registration

Alternatively, pass callbacks when calling start():

callbacks.jsjavascript
Loading...

Event Data Reference

ready Event

ready-event.jsjavascript
Loading...

started Event

started-event.jsjavascript
Loading...

stepChange Event

step-change-event.jsjavascript
Loading...

stepCompleted Event

step-completed-event.jsjavascript
Loading...

completed Event

completed-event.jsjavascript
Loading...

error Event

error-event.jsjavascript
Loading...

close Event

close-event.jsjavascript
Loading...

Removing Event Handlers

Use off to remove event handlers:

remove-handlers.jsjavascript
Loading...

React Event Handling

In React, handle events through component props or the hook:

ReactEvents.tsxtsx
Loading...

Analytics Integration

Use events to track verification funnel analytics:

analytics.jsjavascript
Loading...

Best Practices

  1. Always handle errors

    Provide clear feedback to users when errors occur and offer retry options when possible.

  2. Don't trust client-side completion events

    Always verify results on your backend via webhooks. Use client events only for UI updates.

  3. Track abandonment

    Use the close event to understand where users drop off.

  4. Clean up handlers

    Remove event handlers when components unmount to prevent memory leaks.