Launch-Native Logo
Supabase Backend

Storage (Avatars)

Create a storage bucket for user profile pictures and assets.

If your application allows users to upload profile pictures or any other files, you need to set up a Storage Bucket in Supabase.

1. Create a Public Bucket

Launch-Native uses a default bucket named avatars for user profile pictures.

  1. In your Supabase dashboard, go to Storage (the folder icon in the left sidebar).
  2. Click on New Bucket.
  3. Name the bucket exactly: avatars.
  4. Important: Toggle the Public bucket switch to ON. (This allows the images to be displayed in your React Native <Image> components without needing complex signed URLs).
  5. Click Save.

2. Security Policies (RLS for Storage)

Even though the bucket is public for viewing, you must restrict who can upload or delete files.

  1. Click on your newly created avatars bucket.
  2. Go to the Policies tab.
  3. Click New Policy under the avatars bucket.
  4. Choose For full customization.
  5. Create a policy for INSERT (Uploads):
    • Policy Name: Users can upload their own avatar
    • Allowed operation: INSERT
    • Target roles: authenticated
    • USING expression: auth.uid() = owner
  6. Click Save Policy.

Your storage is now secure: anyone can see the profile pictures, but a user can only upload and modify their own!