Skip to main content

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:
  1. Direct Database Connection - Your app connects directly to PostgreSQL using the Supabase client SDK
  2. Supabase Dashboard Management - Tables, auth, and storage are managed in Supabase’s web dashboard
  3. Row Level Security - Access control is configured in Supabase, not generated by AI
  4. 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.
1

Open Supabase Settings

Click MoreSupabase in the project menu
2

Connect via OAuth

Click “Connect Supabase” and sign in to your Supabase account
3

Authorize Access

Grant Natively permission to access your Supabase projects
4

Select Project

Choose the Supabase project you want to connect
5

Connected

Your Supabase project is now linked to your Natively app
The OAuth connection handles all authentication automatically. You don’t need to manually copy API keys or configure environment variables for the Supabase connection.

Using Supabase in Your App

Once connected, tell the AI what you want to build:
Create a posts feature using my Supabase database.
The posts table has: id, title, content, author_id, created_at.
Show a list of posts and let users create new ones.
The AI will generate the appropriate code to interact with your Supabase database.

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

There is no Database Viewer in Natively for Supabase projects. You must use the Supabase Dashboard.

Supabase Dashboard

Manage your database at supabase.com/dashboard:
FeatureWhere to Find
View/Edit DataTable Editor
Run SQL QueriesSQL Editor
Create TablesDatabase → Tables
Manage AuthAuthentication
File StorageStorage
Edge FunctionsEdge Functions

Creating Tables

In Supabase Dashboard:
  1. Go to Table Editor
  2. Click New Table
  3. Define columns with types and constraints
  4. Enable Row Level Security (RLS)
Always enable Row Level Security (RLS) on your tables for security. Without RLS, anyone with your project URL could access your data.

Authentication with Supabase

Supabase Auth provides multiple authentication methods:
Add login and signup using Supabase authentication.
Support email/password and Google sign-in.

Supported Auth Methods

MethodSetup Required
Email/PasswordReady to use
Magic LinksReady to use
Google OAuthConfigure in Supabase Dashboard
Apple OAuthConfigure in Supabase Dashboard
GitHub OAuthConfigure in Supabase Dashboard
Phone/SMSRequires Twilio setup

Viewing Logs

Backend logs are not available in Natively for Supabase projects.

Where to Find Supabase Logs

Access logs in the Supabase Dashboard:
  1. Go to supabase.com/dashboard
  2. Select your project
  3. Click Logs in the sidebar
Log TypeWhat It Shows
API LogsREST API requests, response codes
Postgres LogsDatabase queries, errors
Auth LogsLogin attempts, signups, OAuth flows
Edge Function LogsServerless function execution
Realtime LogsWebSocket subscription events

Frontend Logs in Natively

While backend logs aren’t available, you can still view frontend console logs:
  1. Click the Logs icon in the preview header
  2. 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
Without RLS enabled, your data is publicly accessible. Always configure appropriate policies before going to production.

Storage

For file uploads, tell the AI:
Let users upload profile pictures and display them on their profile.
Store the images in Supabase Storage.
Configure storage buckets and policies in the Supabase Dashboard under Storage.

Edge Functions

For server-side logic requiring secrets (like OpenAI API calls), use Supabase Edge Functions:
  1. Create functions in Supabase Dashboard → Edge Functions
  2. Deploy via Supabase CLI
  3. 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

Migration from Supabase to Liquid Backend is not possible. However, you can migrate from Liquid Backend (Specular) to Supabase if you have specific requirements that only Supabase can meet.

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:
1

Export Data

Use the Specular API or contact support to export your data
2

Create Supabase Tables

Recreate your schema in Supabase Dashboard
3

Import Data

Import your data using Supabase’s import tools or SQL
4

Connect Supabase

Follow the OAuth connection steps above
5

Update App

Ask the AI to update your app to use Supabase instead of the previous backend

Troubleshooting

  • Try disconnecting and reconnecting via MoreSupabase
  • Check your Supabase project isn’t paused (free tier pauses after inactivity)
  • Verify you authorized the correct Supabase account
  • Check Row Level Security policies in Supabase Dashboard
  • Verify the user is authenticated if your policies require it
  • Review policies under Authentication → Policies
Backend logs for Supabase are only available in the Supabase Dashboard, not in Natively. Go to supabase.com/dashboard → Logs.
  • 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

Resources