> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lynkz.elipseday.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Lynkz Environment Variables: Complete Setup Reference

> Complete reference for all Lynkz environment variables. Includes required Firebase config, optional Resend email keys, and app customization settings.

Lynkz is configured entirely through environment variables — there is no config file to edit. The table below lists every variable the app reads, whether it is required, and what it does. Set these in a `.env.local` file for local development, and in **Vercel → Settings → Environment Variables** for production.

## Variable Reference

| Variable                                   | Required    | Description                    |
| ------------------------------------------ | ----------- | ------------------------------ |
| `NEXT_PUBLIC_FIREBASE_API_KEY`             | ✅           | Firebase web config            |
| `NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN`         | ✅           | Firebase web config            |
| `NEXT_PUBLIC_FIREBASE_PROJECT_ID`          | ✅           | Firebase web config            |
| `NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET`      | ✅           | Firebase web config            |
| `NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID` | ✅           | Firebase web config            |
| `NEXT_PUBLIC_FIREBASE_APP_ID`              | ✅           | Firebase web config            |
| `FIREBASE_SERVICE_ACCOUNT_KEY`             | ✅           | Full JSON from service account |
| `RESEND_API_KEY`                           | Optional    | For magic link emails          |
| `RESEND_FROM_DOMAIN`                       | Optional    | Custom sender domain           |
| `NEXT_PUBLIC_APP_URL`                      | Recommended | Your production URL            |
| `NEXT_PUBLIC_APP_NAME`                     | Optional    | Defaults to Lynkz              |

## Example `.env.local`

Copy this template into a `.env.local` file at the root of your project and fill in each value. Never commit this file — it is already listed in `.gitignore`.

```bash theme={null}
# Firebase web config (from Project Settings → Your apps → Web)
NEXT_PUBLIC_FIREBASE_API_KEY=AIzaSy...
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=123456789
NEXT_PUBLIC_FIREBASE_APP_ID=1:123456789:web:abc123

# Firebase service account key (from Project Settings → Service accounts)
# Paste the full contents of the downloaded JSON file as a single-line string
FIREBASE_SERVICE_ACCOUNT_KEY={"type":"service_account","project_id":"your-project",...}

# Resend (optional — only needed for magic link PIN recovery)
RESEND_API_KEY=re_xxxxxxxxxxxx
RESEND_FROM_DOMAIN=yourdomain.com

# App settings
NEXT_PUBLIC_APP_URL=https://yourdomain.com
NEXT_PUBLIC_APP_NAME=Lynkz
```

<Warning>
  `FIREBASE_SERVICE_ACCOUNT_KEY` and `RESEND_API_KEY` are secret credentials. Never commit them to version control or expose them in client-side code. Store them only as Vercel environment variables (or an equivalent secrets manager if you self-host). Both values are used exclusively in Vercel serverless functions and never sent to the browser.
</Warning>

<Note>
  All `NEXT_PUBLIC_*` variables are intentionally public — Next.js embeds them into the client-side bundle at build time, which means they are visible in the browser. This is by design. Security does not come from keeping these keys secret; it comes from your [Firestore security rules](/setup/firebase), which control exactly what the browser can and cannot read or write regardless of who holds the config values.
</Note>
