# Environment Variables

Set these in **Cloudflare → Workers & Pages → project → Settings → Variables and Secrets**, for both Production and Preview. For local development, copy `.env.example` to `.env.local`.

<p class="callout warning"><code>NEXT_PUBLIC_*</code> variables are <strong>public</strong>. They're compiled into the browser JavaScript at build time, so changing one requires a redeploy. Never put a secret in a <code>NEXT_PUBLIC_*</code> variable.</p>

## Server secrets (Pages Function)

| Variable | Required | Purpose |
| --- | --- | --- |
| `GHL_PRIVATE_INTEGRATION_TOKEN` | **Yes** | HighLevel Private Integration token (contacts and opportunities write). Encrypted secret. |
| `GHL_LOCATION_ID` | **Yes** | HighLevel sub-account (location) ID |
| `GHL_EVENTS_PIPELINE_ID` | **Yes** | Pipeline for event inquiries |
| `GHL_EVENTS_PIPELINE_STAGE_ID` | **Yes** | Starting stage for new inquiries |
| `GHL_EVENT_TYPE_FIELD_ID` | No | Opportunity custom field: event type |
| `GHL_EVENT_GUEST_COUNT_FIELD_ID` | No | Opportunity custom field: guest count |
| `GHL_EVENT_BUDGET_FIELD_ID` | No | Opportunity custom field: budget label |
| `GHL_EVENT_DATE_FIELD_ID` | No | Opportunity custom field: preferred date |
| `GHL_EVENT_MESSAGE_FIELD_ID` | No | Opportunity custom field: message |

If any required variable is missing, `/api/event-inquiry` returns `503` and the form shows its error message.

## Public build-time variables

| Variable | Default / example | Effect when empty or placeholder |
| --- | --- | --- |
| `NEXT_PUBLIC_VOLUNTEER_WEBHOOK_URL` | `https://example.com/webhook/placeholder` | The volunteer form **fakes success and sends nothing** |
| `NEXT_PUBLIC_CORPORATE_WEBHOOK_URL` | `https://example.com/webhook/placeholder` | The corporate form **fakes success and sends nothing** |
| `NEXT_PUBLIC_NEWSLETTER_WEBHOOK_URL` | `https://example.com/webhook/placeholder` | The newsletter sign-up **fakes success and sends nothing** |
| `NEXT_PUBLIC_EVENTS_SUBSCRIBE_URL` | (empty) | The "Add to your calendar" panel is hidden. Accepts `https://` or `webcal://`. |
| `NEXT_PUBLIC_DAF_WIDGET_URL` | (empty) | The DAF panel shows legal name, EIN, and address instead of an embedded widget |
| `NEXT_PUBLIC_CF_IMAGE_BASE` | (empty) | Images are served at original size (no Cloudflare resizing) |
| `NEXT_PUBLIC_FORT_MEDIA_BASE` | `https://cdn.r2.fortadams.org` | Falls back to the same default in code |

## Obsolete (safe to delete from Cloudflare)

- `NEXT_PUBLIC_DONATION_PROVIDER`
- `NEXT_PUBLIC_DONATION_EMBED_CONFIG`

## Configured elsewhere (not in this project)

| Variable | Where |
| --- | --- |
| `GITHUB_OAUTH_CLIENT_ID`, `GITHUB_OAUTH_CLIENT_SECRET` | The Decap OAuth proxy Worker at `decap-oauth.fortadams.org` |

## Not environment variables (for reference)

These integration settings are in code or content, not in environment variables:

| Setting | Location |
| --- | --- |
| FareHarbor booking URLs | `content/tour-booking.json` (CMS) |
| Donation form URL | `src/components/support/DonateWidget.tsx` |
| Membership payment links | `src/lib/support-content.ts` |
| Production site URL | `src/lib/site-config.ts` (`siteConfig.url`) |
| Decap OAuth proxy URL | `public/admin/config.yml` (`backend.base_url`) |