Google OAuth Setup
This guide walks through setting up Google OAuth authentication for both local development and production.
Prerequisites
- Google Cloud project with OAuth consent screen configured. (Google Cloud Console)
Local Development Setup
1. Configure Environment Variables
Create .env file in the Supabase directory: @supabase/.env
touch supabase/.env
2. Add the local Google Credentials
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
3. Restart services
pnpm supabase:stop
pnpm supabase:start
pnpm run dev
Production Setup
2. Configure Supabase Dashboard
- Go to your Supabase project dashboard
- Navigate to Authentication → Providers
- Enable Google
- Add the production Client ID and Client Secret
- Set the redirect URL to your production URL, e.g.
https://yourdomain.com/api/auth/callback/google - Save changes.