Skip to main content
Complete setup guide: see docs/integrations/ProfilePhotos.md in your project repo.

What Is Profile Photo Storage?

Cloud Storage

Photos stored in Supabase Storage

Cross-Device

Same photo on all devices

Automatic Compression

~500KB target size

Fallback

Works locally if upload fails

Quick Overview

1

Create Storage Bucket

In Supabase Dashboard:
  • Storage → New Bucket
  • Name: profile-photos
  • Public: ✅ Enable
2

Set RLS Policies

Photos are uploaded under avatars/{userId}_{timestamp}.jpg. Add these policies (the full setup guide also adds matching UPDATE and DELETE policies):
The full guide also adds matching UPDATE and DELETE policies.
3

Uncomment Implementation

In SupabaseProfilePhotoStorageClient.swift:
  • Uncomment import Supabase
  • Remove comment blocks
4

Enable in CompositionRoot

How It Works

Benefits:
  • ✅ Photos sync across devices
  • ✅ Automatic compression
  • ✅ Public CDN URLs
  • ✅ Graceful fallback to local
  • ✅ Privacy-first (iOS 17+ PhotosPicker)

Prerequisites

  • Supabase project configured
  • Supabase dependency in Storage package
  • User authenticated

What You Get

After setup:
  • ✅ Upload profile photos
  • ✅ Photos sync across devices
  • ✅ Automatic compression
  • ✅ CDN-hosted images
  • ✅ Local fallback if upload fails
  • ✅ No camera permissions needed (PhotosPicker)

Complete Guide

The 12KB comprehensive guide includes:
  • Storage bucket configuration
  • Row Level Security policies
  • Upload implementation
  • Compression strategy
  • Error handling
  • Testing procedures

View Complete Setup Guide

Find complete profile photo storage guide in your project

Storage Module

Storage architecture

Chat Sync

Another optional sync feature

Supabase Setup

Required backend

Building Your App

Customize features

Need Help?

  • 📖 Complete troubleshooting in full guide
  • 💬 Create an issue
  • 🔍 Check Supabase Storage logs