> ## Documentation Index
> Fetch the complete documentation index at: https://help.helloazhenweb.top/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables for Birthday Wall

> Reference for all five environment variables Birthday Wall requires, with a copy-paste .env.local template and guidance on where to set them in Vercel.

Birthday Wall reads its configuration exclusively from environment variables — there are no config files to edit before deploying. You need five variables in total: three for Supabase, one for the public site URL, and one to protect the admin panel. This page documents each one and shows you how to set them up locally and on Vercel.

## Required variables

<ParamField path="NEXT_PUBLIC_SUPABASE_URL" type="string" required>
  The base URL of your Supabase project. You can find it under **Project Settings → API → Project URL** in the Supabase dashboard.

  Example: `https://abcdefghijklmnop.supabase.co`

  This variable is prefixed with `NEXT_PUBLIC_` so it is available in both server and client code.
</ParamField>

<ParamField path="NEXT_PUBLIC_SUPABASE_ANON_KEY" type="string" required>
  The public anonymous key for your Supabase project. Located under **Project Settings → API → Project API keys → anon public**.

  Example: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`

  This key is safe to expose publicly. Row Level Security policies in your database determine what an unauthenticated caller can read or write.
</ParamField>

<ParamField path="SUPABASE_SERVICE_ROLE_KEY" type="string" required>
  The service role secret key for your Supabase project. Located under **Project Settings → API → Project API keys → service\_role** (click **Reveal** to show the value).

  Example: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`

  This key has full, unrestricted access to your database and bypasses all RLS policies. It is used only in server-side API routes and must never appear in browser-side code or be committed to version control.
</ParamField>

<ParamField path="NEXT_PUBLIC_SITE_URL" type="string" required>
  The full public URL of your deployed site, without a trailing slash. This is used for generating absolute links and configuring Supabase auth redirects.

  Example: `https://yourname-birthday.vercel.app`

  After your first Vercel deployment, copy the production URL Vercel assigns and set it here, then redeploy. If you add a custom domain later, update this value to match.
</ParamField>

<ParamField path="ADMIN_PASSWORD" type="string" required>
  The password used to access the admin panel at `/admin`. Choose a strong, unique value — this is the only credential protecting your admin interface.

  Example: `a-long-random-passphrase-here`
</ParamField>

## Local development template

Create a `.env.local` file in the root of your project and fill in the values you collected from Supabase:

```bash theme={null}
NEXT_PUBLIC_SUPABASE_URL=https://xxxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
SUPABASE_SERVICE_ROLE_KEY=eyJ...
NEXT_PUBLIC_SITE_URL=https://yourname-birthday.vercel.app
ADMIN_PASSWORD=your-secret-password
```

<Warning>
  Never commit `.env.local` to version control. Add it to your `.gitignore` file immediately. Your `SUPABASE_SERVICE_ROLE_KEY` and `ADMIN_PASSWORD` are sensitive credentials that must not appear in your git history.
</Warning>

## Setting variables on Vercel

<Tip>
  On Vercel, add these variables in your project's **Settings → Environment Variables** tab before your first deployment — or any time you need to update a value. Vercel encrypts all environment variables at rest and injects them at build time and runtime.
</Tip>

For each variable:

1. Go to your Vercel project dashboard and click **Settings**.
2. Select **Environment Variables** from the left sidebar.
3. Click **Add** and enter the variable name and value.
4. Choose which environments the variable applies to: **Production**, **Preview**, and/or **Development**.
5. Click **Save**.

After adding or changing any environment variable, trigger a new deployment for the changes to take effect. You can do this by pushing a new commit or clicking **Redeploy** in the Vercel dashboard.
