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.
The trusted_metadata field contains an arbitrary JSON object of application-specific data. See the Metadata reference for complete field behavior details.
The untrusted_metadata field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and cannot be used to store critical information. See the Metadata reference for complete field behavior details.
If available, the profile_picture_url is a url of the User’s profile picture set in OAuth identity the provider that the User has authenticated with, e.g. Facebook profile picture.
The authenticator_type string displays the requested authenticator type of the Passkey or WebAuthn device. The two valid types are “platform” and “cross-platform”. If no value is present, the Passkey or WebAuthn device was created without an authenticator type preference.