This directory contains configuration files for Supabase integration.
This file contains your Supabase project credentials:
- URL: Your Supabase project URL
- Anon Key: Your anonymous/public API key
- Safe to include in client apps (iOS, web, etc.)
- Respects Row Level Security (RLS) policies
- Limited permissions based on your database policies
- This is the key you should use in your iOS app
- NEVER use in client-side code (iOS app, web frontend, etc.)
- Bypasses all Row Level Security (RLS) policies
- Has full database access - can read, write, delete anything
- Only use in:
- Server-side code (Node.js, Python, Go, etc.)
- Supabase Edge Functions
- Backend services/APIs
- Admin scripts
- Never commit to public repositories
- ✅ Use
anonKeyin your iOS app - ✅ Set up proper RLS policies in Supabase
- ✅ Use
serviceRoleKeyonly in secure server environments - ✅ Never expose service role key in client code
- ✅ Rotate keys if accidentally exposed
import Foundation
// Access Supabase configuration
let supabaseURL = SupabaseConfig.url
let supabaseKey = SupabaseConfig.anonKey
// Example: Initialize Supabase client
// let supabase = SupabaseClient(supabaseURL: supabaseURL, supabaseKey: supabaseKey)If you prefer using environment variables (for development):
- Create a
.envfile in the project root - Add your credentials:
SUPABASE_URL=https://your-project.supabase.co SUPABASE_ANON_KEY=your_anon_key_here - Use a package like
SwiftDotEnvto load them at runtime
Note: .env files are automatically ignored by git (see .gitignore)