PlopPlop Docs

Environment & secrets

Key config values for inbox routing and API ingestion.

API (apps/api)

  • PORT — API port (defaults to 3003).
  • ALLOWED_API_ORIGINS — comma-separated CORS allowlist (defaults to https://app.plop.email).
  • APP_URL — canonical app URL (defaults to https://app.plop.email, used for billing redirects).
  • NEXT_PUBLIC_SUPABASE_URL — Supabase project URL.
  • SUPABASE_SECRET_KEY — Supabase secret key (sb_secret_... in prod, local service_role JWT in dev).
  • DATABASE_PRIMARY_URL — primary Postgres connection string.
  • DATABASE_LHR_URL — read-replica connection string (use primary in dev).
  • DATABASE_SESSION_POOLER — session pooler connection string (use primary in dev).
  • FLY_REGION — optional region hint for replica routing (Fly.io).
  • LOG_LEVEL — logging level for database/replica routing (debug, info, warn, error).
  • UPSTASH_REDIS_REST_URL — Upstash Redis REST URL (cache for RLS + replication).
  • UPSTASH_REDIS_REST_TOKEN — Upstash Redis REST token.
  • KV_DISABLED — set to true to disable Redis cache (falls back to in-memory).
  • INBOX_ROOT_DOMAIN — shared inbound domain (defaults to in.plop.email).
  • INBOX_WEBHOOK_SECRET — bearer token expected by /webhooks/inbox.
  • RESEND_API_KEY — Resend API key for outbound emails (team invites + auth hook).
  • RESEND_FROM — sender address for outbound emails (example: Plop <no-reply@mail.plop.email>).
  • POLAR_ACCESS_TOKEN — Polar API token (required to enable billing flows).
  • POLAR_ENVIRONMENTproduction or sandbox (defaults to sandbox).
  • POLAR_WEBHOOK_SECRET — webhook signing secret for Polar (required to validate webhooks).
  • POLAR_STARTER_MONTHLY_PRODUCT_ID — Polar product id for starter monthly plan.
  • POLAR_STARTER_YEARLY_PRODUCT_ID — Polar product id for starter yearly plan.
  • POLAR_PRO_MONTHLY_PRODUCT_ID — Polar product id for pro monthly plan.
  • POLAR_PRO_YEARLY_PRODUCT_ID — Polar product id for pro yearly plan.
  • POLAR_ENTERPRISE_MONTHLY_PRODUCT_ID — Polar product id for enterprise monthly plan.
  • POLAR_ENTERPRISE_YEARLY_PRODUCT_ID — Polar product id for enterprise yearly plan.

Local .env example

# apps/api/.env
PORT=3003 # optional (defaults to 3003)
ALLOWED_API_ORIGINS=http://localhost:3000 # CORS allowlist for the app
APP_URL=http://localhost:3000 # app base URL for billing redirects

# Supabase (required)
# For local dev: use local Supabase CLI values (sb_secret_...)
# For prod: use hosted Supabase secret key (sb_secret_...)
NEXT_PUBLIC_SUPABASE_URL=...
SUPABASE_SECRET_KEY=...

# Database (required)
DATABASE_PRIMARY_URL=postgres://...
DATABASE_LHR_URL=postgres://... # use primary in dev
DATABASE_SESSION_POOLER=postgres://... # use primary in dev
LOG_LEVEL=info # optional

# Cache (required unless KV_DISABLED=true)
UPSTASH_REDIS_REST_URL=...
UPSTASH_REDIS_REST_TOKEN=...
KV_DISABLED=true # optional; disable Redis cache for local-only dev

# Inbox ingestion (required for worker webhooks)
INBOX_ROOT_DOMAIN=in.plop.email
INBOX_WEBHOOK_SECRET=... # must match apps/inbox WEBHOOK_AUTH_TOKEN

# Email (team invites + auth hook)
RESEND_API_KEY=...
RESEND_FROM="Plop <no-reply@mail.plop.email>"

# Billing (optional; required only if Polar is enabled)
POLAR_ACCESS_TOKEN=...
POLAR_ENVIRONMENT=sandbox
POLAR_WEBHOOK_SECRET=...
POLAR_STARTER_MONTHLY_PRODUCT_ID=...
POLAR_STARTER_YEARLY_PRODUCT_ID=...
POLAR_PRO_MONTHLY_PRODUCT_ID=...
POLAR_PRO_YEARLY_PRODUCT_ID=...
POLAR_ENTERPRISE_MONTHLY_PRODUCT_ID=...
POLAR_ENTERPRISE_YEARLY_PRODUCT_ID=...

App (apps/app)

  • NEXT_PUBLIC_API_URL — base URL for the API (/trpc + REST, defaults to https://api.plop.email).
  • NEXT_PUBLIC_SUPABASE_URL — Supabase project URL.
  • NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY — Supabase publishable key (sb_publishable_... in prod, local anon JWT in dev).
  • SUPABASE_SECRET_KEY — required by @plop/supabase server client (server-only; use sb_secret_... in prod/dev).
  • RESEND_API_KEY — Resend API key for outbound email (auth hook + invites).
  • UPSTASH_REDIS_REST_URL — Upstash Redis REST URL.
  • UPSTASH_REDIS_REST_TOKEN — Upstash Redis REST token.
  • NEXT_PUBLIC_OPENPANEL_CLIENT_ID — OpenPanel public client id.
  • OPENPANEL_SECRET_KEY — OpenPanel server secret.
  • NEXT_PUBLIC_SENTRY_DSN — Sentry DSN (client + server).
  • PORT — Next.js dev port (defaults to 3000).
  • VERCEL_URL — Vercel deployment URL (used for absolute links).

Local .env example

# apps/app/.env
NEXT_PUBLIC_API_URL=http://localhost:3003 # API base URL
# For local dev: use local Supabase CLI values (sb_publishable_... or anon JWT)
# For prod: use hosted Supabase publishable key (sb_publishable_...)
NEXT_PUBLIC_SUPABASE_URL=...
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=...
SUPABASE_SECRET_KEY=... # sb_secret_... in prod/dev
RESEND_API_KEY=...
UPSTASH_REDIS_REST_URL=...
UPSTASH_REDIS_REST_TOKEN=...

# Optional observability
NEXT_PUBLIC_OPENPANEL_CLIENT_ID=...
OPENPANEL_SECRET_KEY=...
NEXT_PUBLIC_SENTRY_DSN=...

PORT=3000 # optional (defaults to 3000)

Supabase functions (packages/supabase)

  • RESEND_API_KEY — Resend API key used by the auth email hook.
  • SEND_EMAIL_HOOK_SECRET — Supabase hook secret for verifying requests (raw base64 value, no whsec_ prefix).
  • EMAIL_FROM — sender address (example: Plop <no-reply@mail.plop.email>).
  • APP_URL — base URL used for logo links and auth redirects.

Supabase functions read secrets via supabase secrets set (see the Supabase auth email guide in this docs site).

Web (apps/web)

  • NEXT_PUBLIC_SITE_URL — canonical marketing site URL (defaults to https://plop.email).
  • NEXT_PUBLIC_APP_URL — app URL used in marketing links (defaults to https://app.plop.email).
  • NEXT_PUBLIC_LOOPS_FORM_ID — Loops newsletter form id.
  • NEXT_PUBLIC_OPENPANEL_CLIENT_ID — OpenPanel public client id.
  • OPENPANEL_SECRET_KEY — OpenPanel server secret.
  • NEXT_PUBLIC_CAL_LINK — Cal.com scheduling link.

Local .env example

# apps/web/.env
NEXT_PUBLIC_SITE_URL=http://localhost:3001
NEXT_PUBLIC_APP_URL=http://localhost:3000

# Optional marketing integrations
NEXT_PUBLIC_LOOPS_FORM_ID=...
NEXT_PUBLIC_OPENPANEL_CLIENT_ID=...
OPENPANEL_SECRET_KEY=...
NEXT_PUBLIC_CAL_LINK=...

Docs (apps/docs)

  • NEXT_PUBLIC_SITE_URL — base URL for metadata + OG images (defaults to https://docs.plop.email).

Local .env example

# apps/docs/.env
NEXT_PUBLIC_SITE_URL=http://localhost:3002

Inbox worker (apps/inbox)

Wrangler vars:

  • EMAIL_DOMAIN — inbound root domain (for example in.plop.email).
  • EMAIL_WORKER_NAME — deployed worker name (used for routing rules).
  • CLOUDFLARE_ZONE_ID — Cloudflare zone id for the apex domain.
  • WEBHOOK_URL — API endpoint to post inbound email payloads.
  • WEBHOOK_TIMEOUT_MS — optional timeout override.

Bindings:

  • INBOX_STORAGE — R2 bucket binding for stored emails.

Secrets:

  • ADMIN_TOKEN — admin API auth for the worker.
  • CLOUDFLARE_API_TOKEN — Cloudflare token used to manage routing + DNS.
  • WEBHOOK_AUTH_TOKEN — bearer token sent to the API (must match INBOX_WEBHOOK_SECRET).

Keep WEBHOOK_AUTH_TOKEN and INBOX_WEBHOOK_SECRET identical, or webhooks will be rejected with 401.

Local dev notes

  • Update WEBHOOK_URL in apps/inbox/wrangler.toml to http://localhost:3003/webhooks/inbox when testing with the local API.
  • Set ADMIN_TOKEN, CLOUDFLARE_API_TOKEN, and WEBHOOK_AUTH_TOKEN via wrangler secret put (or in CI).

Testing helpers

  • PLOP_API_URL — optional base URL for tests (defaults to https://api.plop.email).
  • PLOP_API_KEY — API key used by E2E polling helpers.

On this page