BackendDatabases
Supabase
Connect to Supabase Postgres.
Connect to Supabase Postgres using the Supabase client SDK.
import { createEngine } from '@superapp/backend'
import { supabaseProvider } from '@superapp/backend/databases/supabase'
const engine = createEngine({
providers: [supabaseProvider],
connections: {
main: {
type: 'supabase',
url: process.env.SUPABASE_URL!,
serviceRoleKey: process.env.SUPABASE_SERVICE_ROLE_KEY!,
},
},
})Install
npm install @supabase/supabase-jsConnection Options
| Option | Type | Description |
|---|---|---|
url | string | Supabase project URL |
serviceRoleKey | string | Service role key (bypasses RLS) |
anonKey | string | Anon key (respects RLS) |
Use serviceRoleKey for backend access. The anon key enforces Row-Level Security and is intended for client-side use.