Represents a user of the app.
The UUID of this user.
Is this user fresh, meaning they haven’t been persisted?
The details (email, password, etc) of this user.
The social details of this user.
The custom data of this user.
Check whether this user is anonymous or not.
id property is set, the user is no longer anonymous.
get(key: string, defaultValue: any)
Get a value from this user’s custom data.
Optionally, a default value can be provided.
The data key to get.
The value to return if the key is absent.
set(key: string, value: any)
Set a value in this user’s custom data.
The data key to set.
The value to set.
Delete a value from this user’s custom data.
The data key to delete.
Revert this user to a fresh, anonymous state.
Save this user to the API.
Delete this user from the API.
load(id?: string): Promise<void>
Load the user from the API, overwriting the local user’s data.
The user ID to load into this user.
Store this user in local storage.
Remove this user from local storage.