Supabasesimon_grimmTutorial
React Native file upload with Supabase Storage
Summary
This tutorial shows how to build a React Native image-sharing or file-sharing app with Expo SDK49, Supabase Authentication, Expo Router v2, and Supabase Storage. It configures a Supabase project, turns off email confirmation for the tutorial, creates a private files bucket, and adds policies that constrain access to an authenticated user’s own folder. The React Native client stores sessions in AsyncStorage, uses the Image Picker and Expo File System, and initializes Supabase with environment-based URL and public key values. The resulting app supports account creation, sign-in, image selection, listing, download-based display, and deletion; resumable uploads are omitted because the attempted implementation produced files with zero bytes.
Context
The tutorial addresses storing files uploaded from a React Native app and combining file storage with authentication, enabling image-sharing, file-sharing, or similar applications without a separate backend implementation.
Approach / What changed
It creates a Supabase project with authentication and a non-public files bucket, applies a storage policy based on the authenticated user ID and folder name, then builds an Expo React Native client using Supabase, AsyncStorage, Expo Router, Image Picker, and Expo File System. The app includes sign-up, sign-in, authentication-state handling, image listing, download-based rendering, and deletion.
Takeaways
The storage policy permits access only when the files bucket is files and the first folder component matches auth.uid() converted to text.
AsyncStorage is supplied as the Supabase client’s auth storage, while detectSessionInUrl is set to false for the React Native environment.
Resumable uploads were left out because the attempted React Native implementation consistently resulted in uploaded files with zero bytes.
Source and freshness
- Source
- supabase.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.