Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Jesus-Puertos/h-ayuntamiento/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Environment variables are critical for configuring your application’s connection to external services like Supabase, email providers, and AI services. This guide covers all required and optional environment variables.Required Variables
Supabase Configuration
These variables are required for the application to function:The
PUBLIC_ prefix makes these variables available in client-side code. This is safe for the anon key as it’s designed to be exposed publicly.Getting Your Supabase Credentials
Access Supabase Dashboard
Go to app.supabase.com and select your project
Optional Variables
Email Configuration (Resend)
For sending transactional emails:These are only required if you’re using email notifications or contact forms. Get your API key from resend.com.
WordPress Integration
If you’re integrating with an existing WordPress site:Backend Security
For securing backend API endpoints:AI Integration (OpenAI)
For AI-powered features:Notion Integration (MCP)
For Notion API integration:Setting Up Your .env File
Production Environment Variables
For production deployments (Vercel, Netlify, etc.), add environment variables through your hosting platform’s dashboard:Vercel
Go to Project Settings
Navigate to your project on vercel.com
Add Variables
Add each variable with its value. Select the appropriate environments (Production, Preview, Development)
Security Best Practices
Do’s and Don’ts
✅ Do:- Use different credentials for development and production
- Rotate keys regularly
- Use strong, random values for secrets
- Store production credentials in your hosting platform’s environment variable system
- Keep a secure backup of your production credentials
- Commit
.envfiles to Git - Share credentials in chat or email
- Use production credentials in development
- Hardcode credentials in your source code
- Use weak or predictable secrets
Using PUBLIC_ Variables
In Astro, variables prefixed withPUBLIC_ are exposed to the client:
Only Supabase’s anon key should be public. Never expose service_role keys, API secrets, or other sensitive credentials with the
PUBLIC_ prefix.Troubleshooting
Variables Not Loading
If your environment variables aren’t being recognized:- Check the file name: Must be exactly
.env(not.env.localor.env.development) - Check the location: Must be in the project root
- Restart the dev server: Environment variables are loaded at startup
- Check for typos: Variable names are case-sensitive
- Remove quotes: Don’t wrap values in quotes unless they contain spaces
Verifying Variables Are Loaded
Create a test endpoint to verify (remove in production):Reference
Complete.env.example file:
