Supabase Integration¶
Doable has deep, first-class integration with Supabase, the open-source Firebase alternative. It's the fastest way to add a real database, authentication, and serverless functions to any project you build in Doable.
Two ways to connect¶
Option A: Connect an existing project¶
If you already have a Supabase project:
- Go to Workspace Settings → Integrations → Browse.
- Find Supabase and click Connect.
- Sign in with your Supabase account (OAuth).
- Select your organization and project from the list.
- Done. Your API keys are securely stored and available to the AI.
Option B: One-click provisioning (recommended)¶
Don't have a Supabase project yet? The AI can create one for you:
- Ask the AI: "I need a database for this app" or "Set up Supabase for this project."
- The AI detects you need a database and opens a provisioning dialog.
- Pick your organization and region.
- Click Create. The AI handles everything:
- Creates a new Supabase project
- Waits for it to become healthy
- Fetches your API keys (anon + service role)
- Runs any schema migrations the AI writes
- Deploys Edge Functions if needed
- Stores credentials securely
- Restarts your dev server with the new environment variables
The entire process takes about 60–90 seconds. When it's done, your app is connected and ready to use the database.
What you get¶
Once connected, the AI has access to 26 Supabase tools via the official MCP server:
Read operations¶
| Tool | Description |
|---|---|
list_tables |
Show all tables in the database |
list_extensions |
List installed PostgreSQL extensions |
list_migrations |
View migration history |
execute_sql |
Run read-only SQL queries |
get_logs |
Retrieve project logs |
get_advisors |
Get performance/security advisors |
get_project_url |
Get the project's public URL |
get_anon_key |
Get the anonymous API key |
generate_typescript_types |
Auto-generate TypeScript types from schema |
list_edge_functions |
List deployed Edge Functions |
Write operations¶
| Tool | Description |
|---|---|
apply_migration |
Run SQL migrations (CREATE TABLE, ALTER, etc.) |
deploy_edge_function |
Deploy a Deno Edge Function |
create_branch |
Create a preview database branch |
delete_branch |
Delete a branch |
merge_branch |
Merge branch into main |
reset_branch |
Reset a branch to clean state |
rebase_branch |
Rebase a branch on main |
Note
Write operations are disabled by default. Enable them per-connection in Workspace Settings → Integrations → Supabase → Allow writes.
Quick database-backed app workflow¶
This is the fastest path from idea to working full-stack app:
You: "Build me a task management app with user accounts"
AI: I'll set up Supabase for the database. [Opens provisioning dialog]
[You pick org + region, click Create]
AI: ✅ Supabase project created. Running migrations...
- Created `tasks` table (id, title, status, user_id, created_at)
- Created `profiles` table (id, name, avatar_url)
- Set up Row Level Security policies
- Generated TypeScript types
Now building the frontend...
The AI automatically:
- Provisions the database
- Designs the schema based on your requirements
- Runs migrations with proper RLS (Row Level Security) policies
- Generates TypeScript types for type-safe queries
- Writes frontend code using
@supabase/supabase-js - Wires everything together with the injected environment variables
Environment variables¶
After provisioning, these are available in your project automatically:
| Variable | Scope | Description |
|---|---|---|
VITE_SUPABASE_URL |
Client | Your project URL (e.g., https://xyz.supabase.co) |
VITE_SUPABASE_ANON_KEY |
Client | Anonymous key (safe for browsers) |
SUPABASE_SERVICE_ROLE_KEY |
Server only | Service role key (never exposed to client) |
Example prompts¶
- "Add a Supabase database with a users table and a posts table"
- "Set up authentication with Google and GitHub login"
- "Create a real-time chat feature backed by Supabase"
- "Add file upload support using Supabase Storage"
- "Deploy an Edge Function that sends welcome emails"
Security¶
- Credentials are encrypted: stored in Doable's credential vault using your instance's
ENCRYPTION_KEY. - Service role key never reaches the browser: only injected server-side.
- Row Level Security: the AI sets up RLS policies by default so users can only access their own data.
- Token refresh: OAuth tokens are automatically refreshed before expiry.
- Rate limiting: one provisioning operation per user at a time.
Supported Supabase features¶
| Feature | Support |
|---|---|
| Database (PostgreSQL) | ✅ Full (tables, views, functions, triggers) |
| Authentication | ✅ Via Supabase Auth (email, OAuth providers) |
| Row Level Security | ✅ AI writes RLS policies automatically |
| Realtime subscriptions | ✅ Via @supabase/supabase-js |
| Storage (file uploads) | ✅ Buckets, policies, signed URLs |
| Edge Functions (Deno) | ✅ Write and deploy from chat |
| Database branching | ✅ Preview branches for testing |
| TypeScript types | ✅ Auto-generated from schema |
Troubleshooting¶
"No Supabase connection found"
- Go to Workspace Settings → Integrations and connect Supabase, or ask the AI to provision a new project.
Provisioning times out
- Supabase project creation can take up to 2 minutes. If it fails, try again; the Management API may be under load.
"Permission denied" errors
- Check that write operations are enabled for the connection.
- Verify RLS policies aren't blocking the operation.
Environment variables not available
- The dev server restarts automatically after provisioning. If variables are missing, try restarting manually: "Restart the dev server."