Supabase Integration
Supabase is an open-source Firebase alternative providing PostgreSQL database, authentication, storage, and edge functions. This guide covers how Supabase works with Natively.Not sure which backend you’re using? If you don’t see a “Database” button in the preview header, you’re using Supabase. See Backend Systems for details.
How Supabase Works in Natively
Unlike Liquid Backend which generates APIs automatically, Supabase works differently:- Direct Database Connection - Your app connects directly to PostgreSQL using the Supabase client SDK
- Supabase Dashboard Management - Tables, auth, and storage are managed in Supabase’s web dashboard
- Row Level Security - Access control is configured in Supabase, not generated by AI
- OAuth Integration - Natively connects to your Supabase project via secure OAuth
Connecting Supabase
Natively uses OAuth to securely connect to your Supabase project—no manual API keys required.Using Supabase in Your App
Once connected, tell the AI what you want to build:What You Can Ask For
- Database operations - Create, read, update, delete records
- Authentication - Sign up, login, password reset using Supabase Auth
- Storage - Upload and display images and files
- Realtime - Subscribe to live database changes
Managing Your Database
Supabase Dashboard
Manage your database at supabase.com/dashboard:| Feature | Where to Find |
|---|---|
| View/Edit Data | Table Editor |
| Run SQL Queries | SQL Editor |
| Create Tables | Database → Tables |
| Manage Auth | Authentication |
| File Storage | Storage |
| Edge Functions | Edge Functions |
Creating Tables
In Supabase Dashboard:- Go to Table Editor
- Click New Table
- Define columns with types and constraints
- Enable Row Level Security (RLS)
Authentication with Supabase
Supabase Auth provides multiple authentication methods:Supported Auth Methods
| Method | Setup Required |
|---|---|
| Email/Password | Ready to use |
| Magic Links | Ready to use |
| Google OAuth | Configure in Supabase Dashboard |
| Apple OAuth | Configure in Supabase Dashboard |
| GitHub OAuth | Configure in Supabase Dashboard |
| Phone/SMS | Requires Twilio setup |
Viewing Logs
Where to Find Supabase Logs
Access logs in the Supabase Dashboard:- Go to supabase.com/dashboard
- Select your project
- Click Logs in the sidebar
| Log Type | What It Shows |
|---|---|
| API Logs | REST API requests, response codes |
| Postgres Logs | Database queries, errors |
| Auth Logs | Login attempts, signups, OAuth flows |
| Edge Function Logs | Serverless function execution |
| Realtime Logs | WebSocket subscription events |
Frontend Logs in Natively
While backend logs aren’t available, you can still view frontend console logs:- Click the Logs icon in the preview header
- View console.log output, errors, and warnings from your React Native code
Row Level Security (RLS)
RLS is crucial for Supabase security. Configure policies in the Supabase Dashboard under Authentication → Policies. Common patterns:- Users read own data - Only see records where user_id matches
- Public read, authenticated write - Anyone can view, only logged-in users can create
- Admin access - Full access for admin users
Storage
For file uploads, tell the AI:Edge Functions
For server-side logic requiring secrets (like OpenAI API calls), use Supabase Edge Functions:- Create functions in Supabase Dashboard → Edge Functions
- Deploy via Supabase CLI
- Tell the AI to call your edge function from the app
Edge Functions are useful when you need server-side processing that can’t be done safely in the frontend.
Migrating from Liquid Backend to Supabase
When to Consider Migration
In most cases, Liquid Backend (Specular) will get you further. Consider Supabase only if you specifically need:- PostgreSQL functions and triggers
- Supabase-specific features (Realtime, Edge Functions)
- Integration with existing Supabase infrastructure
- Direct SQL access
Migration Steps
If you must migrate from Liquid Backend to Supabase:Troubleshooting
Connection failed
Connection failed
- Try disconnecting and reconnecting via More → Supabase
- Check your Supabase project isn’t paused (free tier pauses after inactivity)
- Verify you authorized the correct Supabase account
Permission denied errors
Permission denied errors
- Check Row Level Security policies in Supabase Dashboard
- Verify the user is authenticated if your policies require it
- Review policies under Authentication → Policies
Can't see backend logs
Can't see backend logs
Backend logs for Supabase are only available in the Supabase Dashboard, not in Natively. Go to supabase.com/dashboard → Logs.
Data not showing in app
Data not showing in app
- Check the Table Editor in Supabase Dashboard to verify data exists
- Check RLS policies aren’t blocking access
- Look at API Logs in Supabase for errors