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

onEvent

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

onError

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