Supabase
Add backend database, authentication, and storage to your App2 projects. Connect your own Supabase projects for full backend capabilities.
Written By Nick Gatzoulis
Last updated 3 months ago
What is Supabase integration?
Supabase integration connects your App2 projects to your own Supabase backend, giving you database, authentication, storage, and serverless functions.
What Supabase provides:
PostgreSQL database: Powerful relational database
Authentication: User login and management
Storage: File uploads and media management
Edge Functions: Serverless backend logic
Real-time: Live data updates
Row Level Security: Built-in data protection
How integration works:
Connect your Supabase account (OAuth)
Authorize App2 to access your organizations
Select which Supabase project to link
App2 configures environment variables automatically
AI can build features using your Supabase backend
Note: You keep full control of your Supabase projects. App2 only accesses what you authorize.
Why connect Supabase?
Supabase turns your App2 projects into full-stack applications.
With Supabase, you can:
Add authentication:
User signup and login
Email/password authentication
Social logins (Google, GitHub, etc.)
Password reset flows
Session management
Build with database:
Store user data
Create tables and relationships
Run SQL queries
Real-time data subscriptions
Database migrations
Handle file storage:
Upload images and files
Serve media content
Manage user avatars
Generate signed URLs
Deploy backend logic:
Serverless edge functions
API endpoints
Background jobs
Webhook handlers
AI understands your setup:
Reads your database schema
Generates correct SQL queries
Uses proper authentication patterns
Follows Supabase best practices
Prerequisites
Before connecting Supabase:
Supabase account: Free or paid account at supabase.com
Supabase project: At least one project created in Supabase
App2 workspace: Any tier (Free, Pro, Lifetime)
Workspace role: Owner or Admin permissions
Creating a Supabase project:
Go to app.supabase.com
Click "New Project"
Choose organization
Enter project name and database password
Select region
Wait for provisioning (~2 minutes)
Setup steps

Step 1: Connect Supabase account
Authorize App2 to access your Supabase organizations.
Go to Workspace Settings β Integrations β Supabase
Click "Connect Supabase"
Redirected to Supabase for authorization
Log into Supabase (if not already)
Review permissions requested
Click "Authorize"
Redirected back to App2
Your Supabase account is now connected.
Step 2: Select organizations
App2 discovers all Supabase organizations you authorized.
What you'll see:
List of your Supabase organizations
Projects within each organization
Link status for each project
Last synced timestamp
Step 3: Link project to App2
Connect a Supabase project to your App2 project.
Open your App2 project
Go to Project Settings β General β Supabase Backend
Find "Connect Supabase project" section
Select Supabase project from dropdown
Click "Connect Supabase project"
Linked successfully
Auto-configuration:
Environment variables set automatically
Supabase URL and keys configured
AI can now use Supabase features
Ready to build backend functionality
Linking projects
Connect your Supabase backend to specific App2 projects.
One-to-one linking
Important rule: Each App2 project can link to one Supabase project, and each Supabase project can link to one App2 project.
Why one-to-one:
Prevents configuration conflicts
Clear environment variable management
Isolated backend per app
Better security
If you need multiple apps:
Create separate Supabase projects
Or use one Supabase project for multiple environments (dev, staging, prod)
Environment variables
App2 automatically configures Supabase credentials when you link a project.
Variables added:
Web projects (Vite):
VITE_SUPABASE_URL: Your Supabase project URLVITE_SUPABASE_ANON_KEY: Public anonymous key
Mobile projects (Expo):
EXPO_PUBLIC_SUPABASE_URL: Your Supabase project URLEXPO_PUBLIC_SUPABASE_ANON_KEY: Public anonymous key
Service role key:
Stored securely in Supabase secrets
Used for edge functions
Never exposed in client code
Access in code:
// Web (Vite)
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY
// Mobile (Expo)
const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL
const supabaseAnonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY
Unlinking projects
Remove Supabase connection from an App2 project.
How to unlink:
Go to Workspace Settings β Integrations β Supabase
Find the linked project
Click "Unlink" or "Remove"
Confirm action
What happens:
Link removed from App2 database
Environment variables cleared from project
Supabase project remains intact (not deleted)
Can link to different App2 project
Managing organizations
Viewing organizations
See all connected Supabase organizations and their projects.
Where to view:Workspace Settings β Integrations β Supabase
What you'll see:
Organization names
Projects within each org
Link status (which App2 projects use which Supabase projects)
Last synced timestamp
Action buttons
Refreshing organizations
Sync latest projects from Supabase.
When to refresh:
Created new Supabase project
Deleted Supabase project
Changed project settings
Want latest data
How to refresh:
Find organization in Supabase settings
Click "Refresh" button next to organization
Wait for sync (~5 seconds)
Project list updates
Deleting organizations
Remove Supabase organizations from your workspace.
When you can delete:
Organization has no linked projects
All projects unlinked first
You no longer need the connection
How to delete:
Go to Workspace Settings β Integrations β Supabase
Find organization to remove
Verify no projects are linked (unlink them first if needed)
Click "Delete" or "Remove" button
Confirm deletion
What gets deleted:
Organization connection in App2
Stored access tokens
Project list from that org
What stays intact:
Your Supabase organization (unchanged in Supabase)
All Supabase projects (not deleted)
Data in Supabase (safe)
If projects are linked:
Cannot delete organization
Must unlink all projects first
Error message shows which projects are linked
Tip: Unlink all projects before deleting an organization to clean up unused connections.
Using Supabase
Once linked, ask the AI to build backend features.
AI capabilities with Supabase
The AI can:
Create database tables with migrations
Set up authentication flows
Implement Row Level Security (RLS)
Build API endpoints with edge functions
Configure file storage buckets
Generate TypeScript types from schema
Write database queries
Set up real-time subscriptions
Example prompts:
Authentication:
"Add Supabase authentication with email and password"
"Create signup and login pages using Supabase auth"
"Implement password reset flow with Supabase"
Database:
"Create a 'tasks' table in Supabase with columns: id, user_id, title, completed, created_at"
"Add RLS policies so users can only see their own tasks"
"Write a query to fetch all tasks for the current user"
Storage:
"Set up Supabase storage bucket for user avatars"
"Add image upload functionality using Supabase storage"
"Implement file upload with progress indicator"
Real-time:
"Add real-time subscription to the tasks table"
"Show live updates when tasks change"
"Implement real-time chat using Supabase"
Supabase MCP tools
The AI has access to Supabase MCP tools for direct database operations.
Available tools:
execute_sql: Run SQL querieslist_tables: View database schemaapply_migration: Create database migrationsgenerate_typescript_types: Create type definitionssearch_docs: Look up Supabase documentation
Automatic usage:
AI uses tools when appropriate
Queries docs for best practices
Generates migrations for schema changes
Creates types for type safety
Managing secrets
Use Security Center to manage Supabase secrets (environment variables stored in Supabase).
Access secrets management:
Go to Settings β Security Center
Click Secrets tab
Create, view, or delete secrets
Secrets are stored securely in Supabase and never exposed via API. For detailed instructions, see Security Center - Supabase Secrets.
Tip: Only workspace owners and admins can access secrets. Secret values are never shown after creation for security.
Best practices
Security
Protect your data:
Always implement RLS policies
Never expose service role key in client code
Use anon key for client-side operations
Test RLS policies thoroughly
Monitor Supabase dashboard for suspicious activity
Access control:
Link Supabase projects only to trusted App2 projects
Review authorization permissions
Revoke access when no longer needed
Use separate Supabase projects for dev/prod
Schema management
Database best practices:
Use migrations for all schema changes
Generate TypeScript types after schema updates
Test migrations on development projects first
Document your database schema
Example workflow:
Ask AI to create table with migration
Generate TypeScript types
Test with sample data
Deploy to production
Organization structure
Organize Supabase projects:
One organization per team/company
Separate projects for dev/staging/prod
Or one Supabase project per App2 project
Clear naming conventions
Linking strategy:
Link dev Supabase project to dev App2 project
Link prod Supabase project to prod App2 project
Don't cross-link environments
Troubleshooting
OAuth authorization failed
Issue: Can't connect Supabase account or authorization fails.
Solutions:
Check you're logged into Supabase in same browser
Verify Supabase account has organizations
Try authorization in incognito/private mode
Clear browser cache and cookies
Ensure pop-ups are allowed for App2.dev
No Supabase projects showing
Issue: Connected organization but no projects appear.
Solutions:
Create a Supabase project in that organization
Click "Refresh" button to sync latest projects
Wait a few seconds for projects to provision
Verify organization is active in Supabase dashboard
Can't link Supabase project
Issue: "Connect Supabase project" button disabled or error occurs.
Solutions:
Verify Supabase project isn't already linked to another App2 project
Check you selected a project from dropdown
Ensure you have owner/admin role in App2 workspace
Refresh organization to get latest project list
Try unlinking from other App2 project first
Can't delete organization
Issue: "Delete" option not available or fails.
Solutions:
Check if organization has linked projects
Unlink all App2 projects using this organization first
Verify you're workspace owner/admin
Refresh page and try again
Environment variables not working
Issue: Supabase credentials not available in code.
Solutions:
Verify Supabase project is linked in project settings
Check environment variable names match your framework (Vite vs Expo)
Restart development server/sandbox
Rebuild project if needed
Verify link wasn't removed
FAQ
Do all subscription tiers support Supabase?
Yes. Supabase integration works with Free, Pro, and Lifetime Pro workspaces. It's not tier-restricted.
Does connecting Supabase cost extra?
No extra cost from App2. Supabase has its own pricingβcheck supabase.com/pricing for details. Supabase offers a generous free tier.
Can I use one Supabase project for multiple App2 projects?
No. Each Supabase project can only link to one App2 project. This prevents configuration conflicts and maintains security.
What if I delete my Supabase project?
The link breaks and your App2 project may freeze or show errors. Unlink in App2 first, then delete in Supabase.
Can I change which Supabase project is linked?
Yes. Unlink the current Supabase project, then link a different one. Only one can be linked at a time.
Will App2 modify my Supabase database?
Only when you ask the AI to make changes (create tables, run queries, etc.). App2 doesn't modify your Supabase project without your explicit prompts.
Can I use Supabase auth with my App2 app?
Yes. Ask the AI to implement Supabase authentication. It will create signup/login pages, handle sessions, and configure auth properly.
Do I need to give App2 full access to my Supabase account?
You control which organizations to authorize during OAuth. Only authorized organizations appear in App2. Revoke access anytime in Supabase dashboard.
Can I delete a Supabase organization from App2?
Yes, but only if no App2 projects are linked to projects in that organization. Unlink all projects first, then delete the organization connection.
What happens to my Supabase data if I disconnect?
Nothing. Your Supabase projects, data, and configuration remain unchanged. Disconnecting only removes the link in App2.
Related links
Projects - Linking Supabase to projects
Chat Modes - Building with Supabase
Quick Actions - Check integration status
Workspaces - Organization-level connections