Loading…

    Supabase With React Native,
    Wired Up for You

    Build the app on sample data, connect a backend with one click, and the AI creates the tables, the access rules and the sign-in screens in a real Expo app.

    Email, Google and Apple sign-inPostgresRow level securityImage storage
    TL;DR

    How do I use Supabase in a React Native app?

    By hand you install supabase-js, keep the session in device storage, set the project URL and public key, and turn on row level security for each table. In Fastshot you build the app, connect a backend from the chat card, and the AI does all of it. You do not need your own Supabase account.

    Last updated: November 4, 2026

    How Supabase fits a React Native app

    Supabase is a backend platform built on Postgres. It turns your database into a REST API and protects the rows with row level security, so a React Native app can query it directly with no server of your own in between.

    The app carries two public values, the project URL and a publishable key. Anyone holding them can call your database, so the rules live in the database: every table gets row level security and policies that say who can read or write which rows. A secret key never goes into the app.

    The usual setup in Expo is a handful of steps. Install supabase-js and a session store, create one shared client, read the two values from EXPO_PUBLIC variables, and start and stop token refresh as the app moves to the background and back. Then you write SQL for each table and policy, and build the sign-in screens.

    Fastshot writes those pieces from your description. If you want the bigger picture on accounts and data, read the lesson add a backend to your app. If you are still comparing databases, see Supabase vs Firebase.

    What Fastshot builds on Supabase

    A first version runs on sample data. After you connect the backend, the same screens read and write real data.

    Sign-in screens

    Email and password, Google and Apple sign-in, and a password reset flow. After an email sign-up the screen says to check the mailbox, and the session comes back when the user reopens the app.

    Tables for your records

    One table for each kind of record your app keeps, with an owner column, defaults and foreign keys. The SQL is saved as migrations in the project, so later edits know what exists.

    Row level security on every table

    Policies for select, insert, update and delete tied to the signed-in user. One user can read and change their own rows, and a second user is turned away.

    Image storage

    Buckets for profile photos, post images or receipts, with a folder for each user and policies on who can write there.

    Live updates

    For a chat, a feed or a shared list, the table joins the realtime publication, so a new row from one phone appears on another without a reload.

    Server functions

    When something must not run in the app, such as a call that needs a secret, the AI writes an Edge Function, deploys it and keeps its secrets on the server.

    Prompts that use the backend

    Build on sample data first. After the connection, use prompts like these.

    Build a habit tracker with a list of habits and a daily check-in.
    
    Connect a backend.
    Add email, Google and Apple sign-in. Each user sees only their own habits.
    Save every check-in to the database with the date.
    Let users upload an avatar from their photo library.
    Show a weekly streak that updates on all of my devices.

    Add Supabase to your Fastshot app

    1

    Build on sample data

    Describe the app and let the first version run on sample data kept on the device. A Sample data label sits above the preview. Every screen works, and you can shape the app before any backend exists.

    2

    Open the connect card

    When the app feels right, click Sample data above the preview, open the Backend tab, or ask the AI to connect a backend. A connect card appears in the chat.

    3

    Create the backend

    Create it from the card. Fastshot provisions and manages the Supabase project for the app, so you do not sign up at Supabase.

    4

    Let the AI move the app over

    The AI replaces the on-device store with tables, adds access rules and real sign-in where records belong to a person, and points the same screens at the backend. The label switches to Live data.

    5

    Check a real sign-up

    Create an account in the preview, save a record, reload and see it come back. New accounts start empty, because sample records are not copied. Content the app ships with, like categories, is already in the database.

    6

    Build and publish

    Build the app to your phone, then publish to the App Store and Google Play with your Apple Developer ($99 a year) and Google Play ($25 one-time) accounts. Sign-in works the same way in the installed app.

    Supabase by hand or with Fastshot

    The left column follows the Expo and Supabase guides. The right shows what the AI does for the same task.

    TaskBy hand in ExpoWith Fastshot
    Create the projectSign up at Supabase, create a project, choose a regionClick create on the connect card in the chat
    Client and sessionInstall supabase-js and a session store, write lib/supabase.tsOne shared client for auth, queries, storage and realtime
    URL and keyAdd EXPO_PUBLIC_SUPABASE_URL and the publishable key to .envSet when the backend connects
    Tables and securityWrite SQL in the dashboard, enable RLS, add each policyMigrations saved in the project, with RLS policies per table
    Sign-inBuild the screens, handle email confirmation, wire Google and AppleGenerated screens for email, Google and Apple
    Proof it worksWrite a test screen that queries a tableThe AI signs up, saves a record and reads it back after a reload

    Example: tables for a habit tracker

    A prompt like the one above leads to tables of this shape. Names change with your app.

    TableKey columnsWho can read and write
    profilesid (the user), display_name, avatar_urlThe owner of the row
    habitsid, user_id, name, color, created_atThe owner of the row
    habit_logsid, habit_id, user_id, done_onThe owner of the row
    avatars (storage bucket)One folder per user IDEach user manages their own folder

    Apps built on React Native and Supabase

    Community apps on Fastshot whose prompts name Supabase for accounts and data.

    Songma

    An AI copilot for small business owners in Africa that manages clients, sales and products from a phone. See Songma in the gallery.

    Wealthsphere

    An investment tracker that reads its holdings from a Supabase assets table. See Wealthsphere in the gallery.

    Vibezone

    A friendship app with email and social sign-in through Supabase Auth. See Vibezone in the gallery.

    Frequently Asked Questions

    Does Supabase work with React Native?

    Yes. The supabase-js client runs in React Native, and Expo documents a setup for it with a Postgres database and sign-in. You need a place to keep the session on the device and one shared client for the whole app.

    Is it safe to put the Supabase key in a mobile app?

    The project URL and the publishable key are meant to ship in the app. What protects your data is row level security on every table. The secret key and the database password never go into the app, and Fastshot keeps them on the server.

    How do I keep users signed in after they close the app?

    Store the session on the device and refresh the token while the app is open. The generated sign-in code does this, so a user who signed in yesterday opens the app straight to their data.

    Do I need my own Supabase account to use it in Fastshot?

    No. The connect card creates a Supabase backend that Fastshot manages for your app. You never open the Supabase dashboard to set up tables or policies, because the AI does it from your prompts.

    What happens to my sample data when I connect the backend?

    It stays on the device and is not copied. New accounts start empty. Content the app ships with, such as a list of categories, goes into the database so every user sees it.

    Can I add Google and Apple sign-in?

    Yes. After the backend is connected, ask for "Google sign-in" or "Apple sign-in" and the AI adds the buttons and the session handling next to email sign-in.

    What if my app does not need a backend yet?

    Skip the connect card. The app keeps its data on the device with local storage, and every screen still works. You can connect a backend later, and the same screens move onto it.

    Why use Supabase instead of Firebase for a mobile app?

    Supabase stores data in Postgres tables that you can query with SQL, and row level security keeps each row private. If you want a side-by-side view, read Supabase vs Firebase.

    Build your app with a Supabase backend

    Start on sample data, connect a backend from the chat and test real sign-in on your phone.

    No coding needediOS and Android

    About the Author

    Elvira Dzhuraeva is an expert in AI mobile app development and React Native. A former Senior Product Manager at Google specializing in AI/ML and Generative AI, she is the Founder of Fastshot (YC-backed) and a founding contributor to Kubeflow.

    AI Mobile App DevelopmentReact NativeAI Developer ToolsVibecodingAI/ML Ops