Constructor
new User(uid) → {User}
Parameters:
| Name | Type | Description |
|---|---|---|
uid | string | User's unique id |
Returns:
The new User object
- Type:
- User
Example
const user = new User("nouser")
const user = new User("ejnf24h24ufn2")Classes
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:
| Name | Type | Description |
|---|---|---|
data | object | Data 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:
| Name | Type | Description |
|---|---|---|
email | string | Users email |
password | string | Users password |
Returns:
- Type:
- null
Example
User.create("sample@syntaxforge.dev", "1234") // Creates user