Skip to content

Environment Config

This page consolidates config for local and production Bookmarks deployments.

  • DB (D1): Bookmarks database (bookmarks)
  • AUTH_SERVICE (service binding): cosmos-auth-worker
  • DISCUSSION_ROOM (Durable Object): realtime room class
  • BOOKMARKS_MEDIA (R2): media bucket (bookmarks-media)
VariableLocal defaultProduction
AUTH_MODEdevservice

Notes:

  • AUTH_MODE=dev enables local/dev auth behavior.
  • AUTH_MODE=service expects first-party auth via AUTH_SERVICE.

Primary runtime define used in local/dev:

  • API_BASE_URL (for example http://127.0.0.1:8787 locally, worker domain in prod)
VariablePurpose
PUBLIC_BOOKMARKS_APP_URLURL used by /auth/open-app redirect to app shell
PUBLIC_APP_LOGIN_URLOptional override for login CTA target

Auth worker prerequisites (external dependency)

Section titled “Auth worker prerequisites (external dependency)”

The API worker relies on cosmos-auth-worker being correctly configured.

Minimum expected production configuration:

  • APP_URL points to deployed Bookmarks app URL.
  • MAIL_SERVICE binding is healthy for verification/reset emails.
  • JWT_SECRET configured.
  • ENCRYPTION_KEY configured.
  • GET /health returns ok: true from bookmarks API worker.
  • Login/register/refresh proxies succeed.
  • Authenticated /v1/me returns user context.
  • Club stream websocket connects for a club member.