---
title: "Environment"
description: "One root .env feeds every app."
url: https://pr-194-docs.preview-lehoetel.findmalek.engineer/docs/environment
markdown: https://pr-194-docs.preview-lehoetel.findmalek.engineer/docs/environment.md
---

# Environment

There is one `.env` at the repo root. Every app loads it, and `packages/env` validates it with zod, so a bad value fails at start with a clear message. `.env.example` lists every key with its default, `.env` itself is git-ignored.

## Urls

| Key | What it is |
| --- | --- |
| `API_URL` | how the Next servers reach the api, an internal address on docker |
| `API_PUBLIC_URL` | the api url the browser can reach |
| `WEB_URL` | the landing page |
| `WHATSAPP_CONTACT_NUMBER` | the landing page WhatsApp button: country code and number, digits only. Empty hides the button |
| `DASHBOARD_URL` | the dashboard |
| `DOCS_URL` | this site, read only by `apps/docs` and not part of the `packages/env` schema |

## Database and auth

| Key | What it is |
| --- | --- |
| `DATABASE_URL` | postgres connection string |
| `POSTGRES_PORT` | host port of the local docker postgres |
| `SEED` | `demo` fills an empty database with sample data, `none` never seeds |
| `DEMO_PASSWORD` | password of the seeded demo accounts, default `demo-le-hoetel-2026` (fake, local and previews only) |
| `BETTER_AUTH_SECRET` | `openssl rand -base64 32`, generated for you |
| `ADMIN_EMAIL`, `ADMIN_PASSWORD` | the first admin, created or reset on every api start |
| `LEADS_NOTIFY_EMAIL` | who is emailed when a hotel requests a demo on the landing page, defaults to `ADMIN_EMAIL` |
| `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET` | optional github sign-in |

## Messaging

| Key | What it is |
| --- | --- |
| `MESSAGING_LIVE` | `true` lets email, whatsapp and telegram really send, default `false` |
| `RESEND_API_KEY`, `EMAIL_FROM`, `RESEND_WEBHOOK_SECRET` | email through Resend, and its bounce and complaint webhook |
| `KAPSO_API_KEY`, `WHATSAPP_PHONE_NUMBER_ID`, `KAPSO_WEBHOOK_SECRET` | whatsapp through Kapso, and its status webhook |
| `TELEGRAM_BOT_TOKEN`, `TELEGRAM_CHAT_ID`, `TELEGRAM_WEBHOOK_SECRET` | telegram alerts to you (the operator) |
| `TELEGRAM_BOT_USERNAME` | the bot's username, so hotel managers can link their own chat from hotel settings |

Messages only leave the server when `NODE_ENV=production` and `MESSAGING_LIVE=true`. Everywhere else (local, tests, previews, staging) every channel logs `message not sent, log-only provider` with the channel and template name, never the recipient or the text. Only the production deploy sets `MESSAGING_LIVE=true`, so a preview can never message a real guest even with real keys in its env.

Keys for modules you left out of the project are not in `.env.example`. Adding a key means adding it to the zod schema in `packages/env` first.
