VITE_ prefix as this is a Vite-based React application.
Required Environment Variables
Environment variables in Vite must be prefixed with
VITE_ to be exposed to the client-side code.Core Supabase Configuration
These variables are required for basic Supabase client functionality:.env
Get Supabase URL
Navigate to your Supabase project settings and copy the Project URL from the API section.Example format:
https://your-project-id.supabase.coEdge Function Configuration
The application uses Supabase Edge Functions for metadata extraction and AI-powered tag generation:.env
Edge Function Anon Key
This is typically the same as your
VITE_SUPABASE_ANON_KEY unless you have separate authentication for Edge Functions.Used in: /src/utils/getMetadata.ts:2Metadata Function URL
The URL endpoint for the Edge Function that fetches website metadata (title, description, images).Format:
https://your-project-id.supabase.co/functions/v1/get-metadataUsed in: /src/utils/getMetadata.ts:1,6Environment File Setup
Verifying Configuration
After setting up your environment variables, verify they’re accessible:Check Browser Console
Open your browser’s developer console and verify no Supabase connection errors appear.
Production Deployment
When deploying to production platforms like Vercel or Netlify, add these environment variables in your deployment platform’s dashboard:For deployment-specific instructions, see the Deployment Guide.
Platform-Specific Notes
Vercel:- Add variables in Project Settings > Environment Variables
- Variables are automatically available during build and runtime
- Add variables in Site Settings > Environment Variables
- Ensure variables are set for the production environment
Troubleshooting
Variables not loading in development
Variables not loading in development
- Ensure your
.env.localfile is in the project root - Restart the Vite development server after adding new variables
- Verify variables are prefixed with
VITE_
Supabase connection errors
Supabase connection errors
- Double-check your
VITE_SUPABASE_URLformat - Verify the anon key is copied completely without line breaks
- Ensure your Supabase project is active and not paused
Edge Functions not working
Edge Functions not working
- Confirm Edge Functions are deployed in your Supabase project
- Verify the function URLs match your deployed function names
- Check that the Edge Function anon key has proper permissions