environment property.NEXT_PUBLIC_* variable requires a new deployment because Next.js embeds it at build time.Always copy the project token from the exact PostHog project being inspected. A valid token from another project produces successful-looking requests while Activity and Replay remain empty in the intended project.
zooly-app projectsConfigure both the Dev App and Production App with the following variables. Values differ only where shown.
| Variable | Dev | Production | Purpose |
|---|---|---|---|
NEXT_PUBLIC_POSTHOG_PROJECT_KEY | same project token | same project token | Browser replay SDK |
POSTHOG_PROJECT_KEY | same project token | same project token | Server event delivery |
NEXT_PUBLIC_POSTHOG_HOST | https://us.i.posthog.com | same | Browser ingestion |
POSTHOG_HOST | https://us.i.posthog.com | same | Server ingestion |
NEXT_PUBLIC_JOURNEY_ENVIRONMENT | development | production | Browser event/replay property |
JOURNEY_ENVIRONMENT | development | production | Server and persisted event property |
JOURNEY_EVENT_INGEST_SECRET | unique shared Dev secret | unique shared Prod secret | Auth-to-App endpoint |
CRON_SECRET | secret | secret | Pending-delivery retry endpoint |
POSTHOG_PROJECT_URL=https://us.posthog.com/project/<project-id> is required only where a PostHog UI deep link is built; it is not the ingestion host.
zooly-authAuth routes events back to the App environment that initiated the flow.
| Variable | Value |
|---|---|
NEXT_PUBLIC_POSTHOG_PROJECT_KEY | same token used by App |
NEXT_PUBLIC_POSTHOG_HOST | https://us.i.posthog.com |
NEXT_PUBLIC_JOURNEY_ENVIRONMENT | static environment label for Auth's browser replay anchor |
JOURNEY_EVENT_INGEST_DEV_URL | https://dev.zooly.ai |
JOURNEY_EVENT_INGEST_DEV_SECRET | exactly the Dev App ingest secret |
JOURNEY_EVENT_INGEST_PROD_URL | https://app.zooly.ai |
JOURNEY_EVENT_INGEST_PROD_SECRET | exactly the Production App ingest secret |
The allowed origins are intentionally restricted to dev.zooly.ai, app.zooly.ai, and the supported local Dev origin. The URL and secret for each target must be configured as a matching pair.
Auth's server journey events are classified dynamically from the validated App origin. The Auth browser replay anchor still uses the static NEXT_PUBLIC_JOURNEY_ENVIRONMENT value of the shared Auth deployment; use the parent App's environment as the authoritative session filter until that label is derived dynamically.
zooly.ai)The marketing site records browser sessions with the same project token and ingestion host as the app. Set these on the website project. With no environment label, a visit to zooly.ai or www.zooly.ai is recorded as production.
| Variable | Value |
|---|---|
NEXT_PUBLIC_POSTHOG_PROJECT_KEY | same token used by App |
NEXT_PUBLIC_POSTHOG_HOST | https://us.i.posthog.com |
NEXT_PUBLIC_JOURNEY_ENVIRONMENT | production on the public site |
The home page, conference page, PhotoBomb page, and merch page load the recorder when someone opens the page, so the token is not copied into those files. The website deployment that serves the recorder has to be live. After that, setting the token takes effect on the next visit.
zooly-stats| Variable | Purpose |
|---|---|
READ_ONLY_PROD_DB | Production database used by the executive journey dashboard |
POSTHOG_PROJECT_URL | Base UI URL for direct Replay links |
NEXT_PUBLIC_AUTH_URL | Central Auth origin |
NEXT_PUBLIC_STATS_URL | Deployed Stats origin used for return URLs |
Stats does not need a PostHog ingestion token. It reads aggregate data from Production and only constructs a PostHog UI URL when a replay is available.
Stage carries the same code toward Production, but it has no independent analytics dataset in this design. Do not expect Stage activity in the executive dashboard. Keep Stage credentials and domains aligned with the release strategy rather than inventing a third environment value.
NEXT_PUBLIC_* values changed.Never paste real tokens or secrets into source code, documentation, tickets, or screenshots.