User

View on Github

Represents a user of the app.

Properties

idstring

The UUID of this user.

freshboolean

Is this user fresh, meaning they haven’t been persisted?

detailsUserDetails

The details (email, password, etc) of this user.

socialUserSocialDetails

The social details of this user.

dataIUserData

The custom data of this user.

Methods

isAnonymous(): boolean

Check whether this user is anonymous or not.

If the id property is set, the user is no longer anonymous.

get(keystringdefaultValueany)

Get a value from this user’s custom data.

Optionally, a default value can be provided.

key

The data key to get.

defaultValue

The value to return if the key is absent.

set(keystringvalueany)

Set a value in this user’s custom data.

key

The data key to set.

value

The value to set.

unset(keystring)

Delete a value from this user’s custom data.

key

The data key to delete.

clear()

Revert this user to a fresh, anonymous state.

save(): Promise<void>

Save this user to the API.

delete(): Promise<void>

Delete this user from the API.

load(id?string): Promise<void>

Load the user from the API, overwriting the local user’s data.

id (optional)

The user ID to load into this user.

store()

Store this user in local storage.

unstore()

Remove this user from local storage.

toString(): string

Services

    API

      General