Skip to main content

Supabase Setup

This guide walks you through creating a Supabase project and connecting it to your Nativeline app.

Prerequisites

  • Nativeline installed with a project
  • Email address for Supabase account

Step 1: Create Supabase Account

1

Go to Supabase

Visit supabase.com and click Start your project.
2

Sign up

Create an account with:
  • GitHub (recommended)
  • Or email/password
3

Verify email

If using email, verify via the confirmation link.

Step 2: Create a Project

1

Click 'New Project'

From the dashboard, click New Project.
2

Enter project details

  • Name: Your app name (e.g., “My Todo App”)
  • Database Password: Generate a strong password (save this!)
  • Region: Choose closest to your users
3

Wait for setup

Takes ~2 minutes to provision your project.
Save your database password somewhere secure. You’ll need it if you ever connect directly to the database.

Step 3: Get Your Credentials

Once your project is ready:
1

Go to Settings

Click the Settings icon (gear) in the sidebar.
2

Click API

Select API from the settings menu.
3

Copy credentials

You need two things:
  • Project URL: https://xxxxx.supabase.co
  • anon public key: A long string starting with eyJ...
The anon key is safe to use in your app. It respects Row Level Security policies. Never use the service_role key in client apps.

Step 4: Connect to Nativeline

In your Nativeline chat:
Connect to Supabase with:
- URL: https://your-project-id.supabase.co
- Key: your-anon-key-here
Or go to Settings → Database and enter your credentials there. Nativeline will:
  1. Save your credentials securely
  2. Set up the Supabase client
  3. Be ready to use Supabase features

Step 5: Verify Connection

Test that everything works:
Create a simple test to verify Supabase is connected properly.
Try to read from Supabase and log the result.
You should see a successful connection message in your build output.

Project Structure After Setup

Nativeline creates Supabase-related files:
YourApp/
├── Services/
│   └── SupabaseService.swift    # Supabase client
├── Models/
│   └── (your data models)
└── ...

Common Setup Issues

  • Make sure you’re using the anon key, not service_role
  • Check for extra spaces when copying
  • Verify the key matches your project URL
  • Double-check the project URL
  • Ensure the project finished initializing
  • URL should be https://xxxxx.supabase.co (not dashboard URL)
  • Check your internet connection
  • Project might still be initializing (wait 2-3 minutes)
  • Try refreshing Supabase dashboard
Supabase allows requests from anywhere by default. If you see CORS errors:
  • Verify you’re using the correct URL
  • Check Supabase dashboard for any restrictions

Security Best Practices

Use Row Level Security

Always enable RLS on your tables:
  1. In Supabase dashboard → Table Editor
  2. Click on your table
  3. Enable “RLS” toggle
  4. Add policies
Without RLS, anyone with your anon key can read all data!

Secure Credentials

Nativeline stores your credentials in:
  • macOS Keychain (encrypted)
  • Not in your source code
Never commit credentials to git or share them publicly.

Minimal Permissions

Only enable the Supabase features you need. Don’t enable Storage if you’re only using Auth.

What’s Next?

Now that Supabase is connected, add features: