Carnero.Dev uses three environment variables to connect to Supabase and Resend.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/moradoadrian/carneroDev/llms.txt
Use this file to discover all available pages before exploring further.
RESEND_API_KEY is read at runtime on every request; SUPABASE_URL and SUPABASE_ANON_KEY are referenced in src/lib/supabase.ts, which currently hardcodes those values directly in source — see the note in each field below. Missing values degrade gracefully with warnings logged to the server console. Because the application uses Astro SSR (output: 'server'), runtime variables are resolved via import.meta.env and process.env — they must be present in the runtime process, not just during the build step.
Variable Reference
The full URL of your Supabase project, e.g.
https://xxxx.supabase.co. This value is passed to createClient(supabaseUrl, supabaseKey) in src/lib/supabase.ts.Important: the current source hardcodes this value directly in src/lib/supabase.ts rather than reading it from an environment variable. To use this env var, update supabase.ts to read process.env.SUPABASE_URL instead. You can find the URL in your Supabase project dashboard under Project Settings → API → Project URL.The anonymous (publishable) key for your Supabase project. It is passed as the second argument to
createClient in src/lib/supabase.ts and enforces Row Level Security policies defined on your database tables.Important: the current source hardcodes this value directly in src/lib/supabase.ts rather than reading it from an environment variable. To use this env var, update supabase.ts to read process.env.SUPABASE_ANON_KEY instead. Find the key in your Supabase project dashboard under Project Settings → API → Project API Keys.Your Resend API key, prefixed
re_. Used to authenticate the resend.emails.send() call in src/pages/api/register.ts. If this variable is missing entirely or retains the placeholder value re_your_resend_api_key_placeholder, email sending is skipped and a [RESEND_WARNING] is logged to the server console. The team registration record is still written to Supabase. Obtain your key from the Resend dashboard.Migrating Supabase to Environment Variables
The currentsrc/lib/supabase.ts hardcodes the Supabase credentials:
process.env lookups:
SUPABASE_URL and SUPABASE_ANON_KEY in your deployment environment and they will be picked up at server startup.
.env File Template
Create a.env file in the project root with the following structure before running npm run dev or npm run build. The Supabase entries only take effect after updating src/lib/supabase.ts as described above.
Where Variables Are Used
| Variable | File | Purpose |
|---|---|---|
SUPABASE_URL | src/lib/supabase.ts | Supabase client init URL (currently hardcoded) |
SUPABASE_ANON_KEY | src/lib/supabase.ts | Supabase auth key (currently hardcoded) |
RESEND_API_KEY | src/pages/api/register.ts | Email dispatch authentication |
Behavior When Missing
Understanding the failure modes for each variable helps you diagnose issues in production without guesswork.SUPABASE_URL or SUPABASE_ANON_KEY missing: Because the current source hardcodes these values, removing them from the environment has no effect on Supabase connectivity. If you have migrated supabase.ts to read from process.env and the variables are absent, the Supabase client initializes with undefined values. The application starts without errors, but the first database operation — the .insert() call inside POST /api/register — throws a runtime error, resulting in a 500 response with { "error": "[ERROR_DE_SISTEMA]: No se pudo guardar la información en base de datos: ..." } and a [SUPABASE_DB_INSERT_ERROR] entry in the server console.
RESEND_API_KEY missing: The registration API detects the absent or placeholder key before instantiating the Resend client:
200 response with:
Accessing Variables in Code
Astro exposes environment variables through two mechanisms that behave identically in the SSR context:import.meta.env— Astro’s environment variable interface, available in both build-time and SSR request-time contexts.process.env— The standard Node.js environment object, available in any server-side code.
src/lib/supabase.ts to read Supabase credentials from process.env, those values are resolved at module initialization time when the server process starts. A full server restart is required for updated environment variable values to take effect.