Managing Users

Users are the core of your application. Supabase Auth provides a complete user management system, including sign up, sign in, email verification, password recovery, and more.

How does Supabase store user data?

Supabase stores user data in a table called auth.users. auth is an internal schema that is created when you initialize Supabase.

  • When new users sign up, they are added to this table.
  • This table and tables related in the auth schema are automatically updated when users update their login information

Storing more information about users

  • However this table doesn't contain any more data other than email and identifying information. Since we want to store more information about our users, we use a table called user_profiles.
  • user_profiles is a table which allows users to update their public information such as name and avatar. (avatar image is stored in supabase storage and the url is stored here).
  • Users can also store their private preferences in the user_private_info table. This table is only accessible by the user whose id matches the `user_id` column. Both the tables mentioned above have as a foreign key.
  • Hence if you want to add more public information about your users, you can add a new column to `user_profiles` and if you want to add more private information, you can add a new column to `user_private_info`.