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
-
Go to your Supabase Dashboard
- Visit https://supabase.com/dashboard
- Select your project
-
Navigate to Project Settings
- Click on the "Settings" icon in the sidebar
- Go to "API" section
-
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
- Project URL: Should look like
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
- The URL in your .env must match EXACTLY what's in Supabase dashboard
- Make sure there are no trailing slashes in the URL
- The anon key should be the "anon" or "public" key, NOT the service role key
After updating .env
- Stop your dev server (Ctrl+C)
- Start it again:
npm run dev - Try signing up again
Alternative: Create a new Supabase project
If you're having issues, you can create a fresh project:
- Go to https://supabase.com/dashboard
- Click "New Project"
- Set up the project
- Copy the new URL and anon key
- Update your .env file
Configure Authentication in Supabase
- In your project dashboard, go to Authentication > Settings
- Set these values:
- Site URL:
http://localhost:3000 - Redirect URLs: Add
http://localhost:3000/auth/callback
- Site URL:
- 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.