User

Creates a new user object

Constructor

new User(uid) → {User}

Parameters:
NameTypeDescription
uidstringUser's unique id
Returns:
The new User object
Type: 
User
Example
const user = new User("nouser")
const user = new User("ejnf24h24ufn2")

Classes

User

Methods

(async) admin() → {boolean}

Check if a user is an admin or not
Returns:
True if admin, false if not
Type: 
boolean
Example
const admin = user.admin() // true or false

(async) get() → {object}

Get the users public data from firebase
Returns:
The data returned in the form of a dict
Type: 
object
Example
const data = user.get() // returns {} if user.uid == "nouser" or data not found
const data = user.get() // returns data if found

(async) update(data) → {null}

Add data to users public directory
Parameters:
NameTypeDescription
dataobjectData to add users public dir
Returns:
Type: 
null
Example
user.update({"name": "test"}) // adds "name": "test" to public

(async, static) create(email, password) → {null}

Creates a new user
Parameters:
NameTypeDescription
emailstringUsers email
passwordstringUsers password
Returns:
Type: 
null
Example
User.create("sample@syntaxforge.dev", "1234") // Creates user