Skip to main content
Callbacks are optional functions that allow you to take actions in your app or send logs to your backend based on where your user is in the authentication flow.

onEvent

A function that is called when the Stytch client makes a request. The function expects an argument of an event object, and the event object has type and data objects.

Email OTP

OAuth

Passwords

SSO

SMS OTP

TOTP

onError

A function that is called when an error occurs. The function expects an argument of an StytchError object, and the StytchError object has a message property.