Run it locally

Environment variables

Complete reference for every environment variable used across Prood applications.

Prood uses a single root .env.local file for local development. Run pnpm env:link to generate ignored apps/*/.env.local files with app-specific auth URL overrides.

Database

VariableRequiredUsed byDescription
DATABASE_URLYesAll appsNeon Postgres connection string. Shared by commerce data (@prood/platform) and Better Auth tables.
DATABASE_URL="postgresql://user:password@host/db?sslmode=require"

Multi-tenancy

VariableRequiredUsed byDescription
NEXT_PUBLIC_PLATFORM_DOMAINProdStorefront, Dashboard, APIApex for merchant storefront subdomains only ({slug}.prood.app). Platform services run on prood.com. Example: prood.app.

Storage

VariableDefaultDescription
S3_ENDPOINT—S3-compatible endpoint (R2, AWS, MinIO)
S3_BUCKET—Bucket name
S3_ACCESS_KEY_ID—Access key
S3_SECRET_ACCESS_KEY—Secret key
S3_PUBLIC_URL—Public URL for uploaded assets (required for S3)

Files uploaded through uploadForTenant() are namespaced per tenant: org/<orgId>/….

Authentication (Better Auth)

VariableRequiredUsed byDescription
BETTER_AUTH_SECRETYesAPI, dashboard, admin, storefrontSession signing secret. Generate: openssl rand -base64 32
AUTH_PROXY_SECRETProdAPI, dashboard, adminDashboard and admin send it in a header next to the client address they pass to the API. The API believes that address only when the secret matches, and keys auth rate limits on it. Use the same value on all three. Required in production. Generate: openssl rand -base64 32
BETTER_AUTH_URLYesAPI, dashboard, adminPublic origin of the API, which issues all merchant sessions: http://localhost:3005. Do not set it on the storefront, which infers its origin per store.
NEXT_PUBLIC_AUTH_URLYesDashboard, adminOrigin their auth proxies forward sign-in/sign-up/org ops to. Same as API: http://localhost:3005
NEXT_PUBLIC_DASHBOARD_URLYesAPI, dashboardMerchant admin URL, e.g. https://dashboard.prood.com. On Vercel preview deploys, set this on the API project to your dashboard URL (e.g. https://dashboard-prood.vercel.app).
NEXT_PUBLIC_ADMIN_URLYesAPI, adminPlatform admin URL, e.g. https://admin.prood.com.
NEXT_PUBLIC_STOREFRONT_URLYesAPI, dashboard, storefrontStorefront apex, e.g. https://prood.app. Stores are its subdomains, so never a single store's host.
AUTH_COOKIE_DOMAINProdAPIShared cookie domain for dashboard + API on *.prood.com, e.g. .prood.com. Unset locally and on *.vercel.app preview URLs (browsers cannot share cookies across separate *.vercel.app hostnames).

Seed credentials

VariableDescription
ADMIN_EMAILInitial platform admin email (used by pnpm db:seed)
ADMIN_PASSWORDInitial platform admin password

Payments

There are no payment environment variables. Each store connects its own account in the dashboard, under Integrations, and the credentials are stored encrypted in integration_config. See Payment integration.

Checkout app

VariableRequiredDescription
CHECKOUT_URLYesPublic URL of apps/checkout. Storefront redirects here after order placement. Default: http://localhost:3004
CHECKOUT_API_SECRETYesShared secret between storefront and checkout. Sent as x-checkout-secret header. Generate: openssl rand -base64 32
COMMERCE_API_URLYesAPI base for webhook forwarding. Default: http://localhost:3005/v1

Upstash Redis

VariableRequiredUsed byDescription
KV_REST_API_URLCheckout, production authapps/checkout, apps/api, apps/storefrontRedis REST endpoint for checkout sessions and auth rate limits
KV_REST_API_TOKENCheckout, production authapps/checkout, apps/api, apps/storefrontRedis REST token

Checkout sessions (@prood/checkout-host) are persisted in Redis with a configurable TTL. Without Redis, the checkout app cannot create or load sessions. The API and the storefront each keep their auth rate limits in the same Redis, because serverless instances don't share memory. Without it they count in memory, which is fine locally and not in production.

Dashboard (Vercel domains)

Optional for local dev; required for custom domain provisioning in production:

VariableDescription
VERCEL_TOKENVercel API token
STOREFRONT_VERCEL_PROJECT_IDStorefront Vercel project ID. Do not use Vercel's injected VERCEL_PROJECT_ID; it points at the current project, not necessarily the storefront.
VERCEL_TEAM_IDVercel team ID (if applicable)

Commerce API

VariableDefaultDescription
COMMERCE_API_URLhttp://localhost:3005/v1Base URL for @prood/api-client in storefront and dashboard
API_PUBLIC_URLhttp://localhost:3005Public API origin for Agent Auth OpenAPI proxy and discovery
AGENT_PROXY_API_KEYS_BY_ORG{}JSON object mapping organization IDs to tenant-scoped API keys for proxied agent requests
TRUST_PROXYfalseSet true behind a reverse proxy for JWT aud validation

Integration encryption

VariableDescription
INTEGRATION_ENCRYPTION_KEYYes

Marketing site

VariableDescription
NEXT_PUBLIC_DOCS_URLDocs site URL (default http://localhost:3003)

Per-app summary

AppCritical vars
storefrontDATABASE_URL, COMMERCE_API_URL, BETTER_AUTH_SECRET, KV_REST_API_*, CHECKOUT_URL, CHECKOUT_API_SECRET
dashboardDATABASE_URL, COMMERCE_API_URL, BETTER_AUTH_SECRET, AUTH_PROXY_SECRET, NEXT_PUBLIC_AUTH_URL, INTEGRATION_ENCRYPTION_KEY
checkoutKV_REST_API_*, CHECKOUT_API_SECRET, COMMERCE_API_URL
apiDATABASE_URL, BETTER_AUTH_*, AUTH_PROXY_SECRET, KV_REST_API_*, AUTH_COOKIE_DOMAIN, storage keys, CHECKOUT_API_SECRET, INTEGRATION_ENCRYPTION_KEY, RESEND_*
adminDATABASE_URL, BETTER_AUTH_SECRET, AUTH_PROXY_SECRET, NEXT_PUBLIC_ADMIN_URL
docsNone (static site; OpenAPI synced at build time)

Production checklist

  1. Generate strong secrets: BETTER_AUTH_SECRET, AUTH_PROXY_SECRET, CHECKOUT_API_SECRET, INTEGRATION_ENCRYPTION_KEY
  2. Configure NEXT_PUBLIC_PLATFORM_DOMAIN for subdomain tenants
  3. Provision Upstash Redis for checkout and auth rate limits, and set KV_REST_API_* on API, storefront and checkout
  4. Set RESEND_API_KEY and a verified-domain RESEND_FROM_EMAIL
  5. Run pnpm db:migrate against the production database on every deploy that adds migrations