Connect your project to Supabase for auth, database, and realtime.
- Project URL (looks like https://xyzabc.supabase.co)
- Anon key (also called "publishable key")
Open Settings → Integrations and paste both values. Or add them directly to your project's environment variables:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
- http://localhost:3000/auth/callback (development)
- https://yourdomain.com/auth/callback (production)
Supabase uses RLS to secure your tables. Every generated project enables RLS by default. The AI generates appropriate policies, but you should review them:
is_admin flag on the profiles tableWhen you modify your schema, regenerate the TypeScript types:
npx supabase gen types typescript --project-id your-project-id > src/lib/supabase/types.ts
→ Check that NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY are set in your .env.local file.
→ Make sure your profiles table has a trigger on auth.users to create profiles on signup.
→ Enable the provider in Supabase → Auth → Providers, and add the callback URL to the provider's allowed redirect URIs.