Supabase Integration
Add database, authentication, and storage to your app.
What is Supabase?
Supabase is an open-source Firebase alternative providing:
- PostgreSQL database
- Authentication (email, OAuth, magic links)
- File storage
- Real-time subscriptions
- Row Level Security (RLS)
Setup
- Click Extensions in your project
- Select Supabase
- Enter your Supabase credentials:
- Project URL
- Anon/Public key
Get Supabase Credentials
- Go to supabase.com
- Create a project (free tier available)
- Go to Settings → API
- Copy:
- Project URL
anonpublic key
What Gets Generated
When you add Supabase, the AI automatically:
- Installs
@supabase/supabase-js - Creates a Supabase client
- Sets up authentication hooks
- Generates database schemas
- Implements RLS policies
Common Use Cases
User Authentication
// Generated automatically
const { data, error } = await supabase.auth.signUp({
email: 'user@example.com',
password: 'secure-password'
});
Database Queries
const { data } = await supabase
.from('tasks')
.select('*')
.eq('user_id', userId);
File Upload
const { data } = await supabase.storage
.from('avatars')
.upload('user-avatar.png', file);
Security
All generated code includes:
- Row Level Security (RLS) policies
- Secure authentication flows
- Environment variable protection
- HTTPS-only connections