Skip to main content

Supabase Authentication Setup

This guide will walk you through setting up authentication in your Supabase project.

1. Enable Authentication Providers

  1. Go to your Supabase dashboard
  2. Navigate to Authentication > Providers
  3. Enable the following providers:
    • Email (for Magic Link)
    • Google (for Google Sign-In)
  1. In the Email provider settings:

    • Enable "Magic Link"
    • Configure your site URL
    • Set up redirect URLs
    • Customize email templates
  2. Update your environment variables:

    NEXT_PUBLIC_SITE_URL=http://localhost:3000
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key

3. Set Up Google Authentication

  1. Follow the Google Sign-In Setup guide
  2. Add the Google credentials to your environment:
    GOOGLE_CLIENT_ID=your_google_client_id
    GOOGLE_CLIENT_SECRET=your_google_client_secret

4. Test Authentication

  1. Start your development server
  2. Test Magic Link authentication
  3. Test Google Sign-In
  4. Verify redirect flows

Next Steps

  1. Configure email templates
  2. Set up Row Level Security
  3. Deploy to production