Skip to main content
The Stytch SDK caches the currently logged-in user. user.getSync is a synchronous method that fetches the currently logged-in User from the cache. If there is no cached data, this method returns null. The user.getInfo method is similar to user.getSync, but returns an object containing the user object and a fromCache boolean. If fromCache is true, the user object is from the cache and a state refresh is in progress. You can listen for changes with the user.onChange method, which invokes your callback whenever the user object changes. If you need to asynchronously fetch guaranteed-fresh data from the API, use the user.get method.

Response

object
See the User object for complete response field details.
boolean
Whether the User data is from persistent storage.