Skip to main content
The Stytch SDK stores the currently logged-in in local storage. and will periodically refresh the cached data from the API. Use the self.onChange method to listen for and react to changes to the Member object.
Before using this method, enable in the Frontend SDK page.
If you need to asynchronously fetch guaranteed-fresh data from the API, use the self.get method.

Parameters

function
The callback function to call when the Member changes. The first parameter is the updated Member object.

Return value

function
The function to call to unsubscribe from the member change event.