Back

User Preferences

  • 0
  • Users
  • Flutter
  • Accounts
tahakhawaja
19 Jul, 2023, 20:27

What does the "User Preferences" feature mean in the "Auth" section of Appwrite? I am currently creating a feature for my front-end web app, and would like users to be grouped into two groups.. "entrepreneur" or "coach". Would the "User Preferences" feature be used for this sort of user grouping?

TL;DR
The user wants to create a metadata collection that allows each user to only read their own data. They are wondering if they need to create a separate collection to set limitations for each user type. The "User Preferences" feature in the "Auth" section of Appwrite is a JSON object that can hold user-related information up to 64 kb in size. It can be used to save common user details like preferred local, preferred theme, last read article, etc. If sensitive data needs to be saved, it is recommended to create another collection and give each user only read access. The user also asks if the "User Preferences" feature can
Binyamin
19 Jul, 2023, 22:52

The User Preferences is a json object that can have a size of up to 64kb that can hold any user-relate information.

For example it can be used for saving common insensitive user details, as

  • Preferred local
  • Preferred theme
  • Last read article
  • etc.

So it could look like this

TypeScript
{
    "$id": "5e5ea5c16897e",
    "status": true,
    "email": "john@appwrite.io",
    "phone": "+4930901820",
    "emailVerification": true,
    "phoneVerification": true,
    "prefs": {
      "lang":"es",
      "theme":"light",
      "last_post":"25664eabf",
    }
}

I said insensitive as this data is not protected one and can be changed by the user,

If you want to save data like user subscription details, and expire date for example. Then it will be best to create another collection and give each user just the read access.

alza
20 Jul, 2023, 19:02

I have a similar issue @Binyamin, since i also want to be able to direct users into two different types of read access, depending on their user type. So you mean to achieve this, I have to create a second collection and in this collection set the limitations for which screens each user type will be able to read?

Binyamin
20 Jul, 2023, 19:05

Yes, That sounds right Creating a meta data collection letting each user to read only is own data.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more