.env.example:1-18.
Quick Setup
Create your.env file from the example:
Client-Side Variables
These variables are prefixed withVITE_ and are embedded into the frontend bundle at build time.
Supabase project URL. Used by the frontend to connect to your Supabase instance.Find this in your Supabase Dashboard → Project Settings → API.
Supabase publishable (anonymous) key. This is safe to expose in the frontend.Find this in your Supabase Dashboard → Project Settings → API.
Override the default auth redirect URL for Magic Link and Google OAuth.Defaults to
<origin>/app if not specified. Useful for custom domain setups.Server-Side Variables
These variables are used by Vercel serverless functions in the/api/* routes.
Supabase Configuration
Supabase project URL for server-side API routes. Recommended for Typically the same as
/api/admin/* endpoints.VITE_SUPABASE_URL, but kept separate for server context.Supabase service role key with admin privileges. Required for Find this in Supabase Dashboard → Project Settings → API →
/api/admin/users and other admin routes.service_role key.Fanbasis Integration
API key for Fanbasis integration. Required for Contact your Fanbasis account manager to obtain this key.
/api/admin/fanbasis webhook and product management.Server-side override for Fanbasis purchase magic link redirect URL.Defaults to
<origin>/app if not specified.Admin & Auth Configuration
Redirect URL for password reset emails triggered by admin actions.Defaults to the application origin if not specified.
Apify Integration
Apify API token. Required for Landing Ripper capture runs via Generate this token in your Apify account settings.
/api/landing-ripper/*.The Apify Actor ID used for Landing Ripper scraping operations.Find this in your Apify Actor’s settings page.
Secret used to validate webhook requests to Optional but recommended for production to prevent unauthorized webhook calls.
/api/landing-ripper/webhook.Application Configuration
Absolute public URL of your application. Used when building webhook URLs and download links.If not specified, the application will attempt to infer the URL from request headers.
Environment-Specific Configuration
Local Development
For local development, you typically need:.env
Vercel Deployment
In Vercel, add environment variables in:
- Project Settings → Environment Variables
- Configure separately for Production, Preview, and Development environments
- Navigate to your Vercel project dashboard
- Go to Settings → Environment Variables
- Add each variable with the appropriate scope:
- Production: Used for
mainbranch deploys - Preview: Used for
stagingbranch and other preview deploys - Development: Used for local Vercel dev command
- Production: Used for
Staging vs Production
Use different Supabase projects or database branches for staging and production: Staging (Preview environment):Security Best Practices
- Rotate Keys Regularly: Periodically regenerate API keys and service role keys
- Use Different Keys Per Environment: Never reuse production keys in staging/development
- Restrict Service Role Usage: Only use
SUPABASE_SERVICE_ROLE_KEYin server-side code - Validate Webhooks: Always set
APIFY_LANDING_RIPPER_WEBHOOK_SECRETin production - Monitor Access: Review Supabase and Apify access logs regularly
Troubleshooting
Variables Not Loading
- Ensure variable names are spelled correctly (case-sensitive)
- For client variables, remember the
VITE_prefix is required - Restart the dev server after changing
.envfile - In Vercel, redeploy after adding/updating environment variables
CORS Issues
If you encounter CORS errors:- Verify redirect URLs are configured in Supabase Auth settings
- Ensure
VITE_MAGIC_LINK_REDIRECT_URLmatches your allowed redirect URLs - Check that your domain is whitelisted in Supabase → Authentication → URL Configuration