Skip to main content

Source: ocean/docs/SUPABASE_SETUP.md | ✏️ Edit on GitHub

Supabase Setup Instructions

Finding Your Correct Supabase URL

The "Failed to fetch" error is because we need the correct Supabase project URL.

Steps to find your URL

  1. Go to your Supabase Dashboard

  2. Navigate to Project Settings

    • Click on the "Settings" icon in the sidebar
    • Go to "API" section
  3. Copy the correct values

    • Project URL: Should look like https://[your-project-ref].supabase.co
    • Anon/Public Key: Should start with eyJ... (JWT format) or your format

Update your .env file

# Supabase Configuration
VITE_SUPABASE_URL=https://YOUR_PROJECT_REF.supabase.co
VITE_SUPABASE_ANON_KEY=your_actual_anon_key

Important Notes

  1. The URL in your .env must match EXACTLY what's in Supabase dashboard
  2. Make sure there are no trailing slashes in the URL
  3. The anon key should be the "anon" or "public" key, NOT the service role key

After updating .env

  1. Stop your dev server (Ctrl+C)
  2. Start it again: npm run dev
  3. Try signing up again

Alternative: Create a new Supabase project

If you're having issues, you can create a fresh project:

  1. Go to https://supabase.com/dashboard
  2. Click "New Project"
  3. Set up the project
  4. Copy the new URL and anon key
  5. Update your .env file

Configure Authentication in Supabase

  1. In your project dashboard, go to Authentication > Settings
  2. Set these values:
    • Site URL: http://localhost:3000
    • Redirect URLs: Add http://localhost:3000/auth/callback
  3. Save changes

Test with cURL once you have the right URL

# Replace with your actual values
curl https://YOUR_PROJECT.supabase.co/rest/v1/ \
-H "apikey: YOUR_ANON_KEY" \
-H "Authorization: Bearer YOUR_ANON_KEY"

This should return {"swagger":"2.0"...} if the connection works.