Back to Library
Supabase Integration Context
context
Context for working with Supabase database, auth, and storage
supabasedatabaseauthpostgresql
Prompt Content
# Supabase Integration
## Client Setup
```typescript
// Browser client
import { createClient } from '@/lib/supabase/client'
// Server client
import { createClient } from '@/lib/supabase/server'
```
## Database Patterns
- Use RLS policies for security
- Prefer server-side queries when possible
- Handle errors gracefully
## Common Operations
```typescript
// Select
const { data, error } = await supabase
.from('table')
.select('*')
// Insert
const { data, error } = await supabase
.from('table')
.insert({ column: value })
```
## Auth Flow
- Use middleware for protected routes
- Check auth state with getUser()Details
- Category
- context
- Version
- 1
- Created
- 12/12/2025
- Last Updated
- 12/12/2025