Prood
Getting Started

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
DEFAULT_TENANT_ORG_IDDevStorefront, APIFallback org when host-based tenant resolution fails. Set to seeded org id after pnpm db:setup. Unset in production → unmatched hosts return 404.
NEXT_PUBLIC_PLATFORM_DOMAINProdStorefront, Dashboard, APIApex for merchant storefront subdomains only ({slug}.prood.app). Platform services run on prood.com. Example: prood.app.

Commerce engine

VariableDefaultDescription
COMMERCE_CURRENCYEURDefault store currency (ISO 4217).

Storage

VariableDefaultDescription
STORAGE_PROVIDERvercel-blobvercel-blob or s3
BLOB_READ_WRITE_TOKENVercel Blob token (when STORAGE_PROVIDER=vercel-blob)
S3_ENDPOINTS3-compatible endpoint (R2, AWS, MinIO)
S3_REGIONautoS3 region
S3_BUCKETBucket name
S3_ACCESS_KEY_IDAccess key
S3_SECRET_ACCESS_KEYSecret key
S3_PUBLIC_URLPublic CDN URL for uploaded assets

Uploaded files are namespaced per tenant: org/<orgId>/… via uploadForTenant().

Authentication (Better Auth)

VariableRequiredUsed byDescription
BETTER_AUTH_SECRETYes (prod)API, dashboard (SSR), storefrontSession signing secret. Generate: openssl rand -base64 32
BETTER_AUTH_URLYesAPI (and storefront)Public origin of the Better Auth HTTP handler. API: http://localhost:3005. Storefront: http://localhost:3000. Dashboard does not host /api/auth.
NEXT_PUBLIC_AUTH_URLYesDashboard (browser)Origin the dashboard auth client calls for sign-in/sign-up/org ops. Same as API: http://localhost:3005
NEXT_PUBLIC_DASHBOARD_URLProdAPI (trustedOrigins)Merchant 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).
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 during db:migrate seed)
ADMIN_PASSWORDInitial platform admin password

Payments

VariableDefaultDescription
DEFAULT_PAYMENT_PROVIDERstripeDefault gateway: stripe, easypay, or ifthenpay

Stripe

VariableDescription
STRIPE_SECRET_KEYServer-side Stripe secret key
STRIPE_WEBHOOK_SECRETWebhook signing secret
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYClient-side publishable key (checkout app)

Easypay (Portugal)

VariableDescription
EASYPAY_ACCOUNT_IDEasypay account ID
EASYPAY_API_KEYAPI key
EASYPAY_BASE_URLhttps://api.prod.easypay.pt (prod) or https://api.test.easypay.pt (sandbox)

Ifthenpay (Portugal)

VariableDescription
IFTHENPAY_ANTIPHISHING_KEYAnti-phishing verification key
IFTHENPAY_MB_KEYMultibanco key
IFTHENPAY_MBWAY_KEYMB WAY key
IFTHENPAY_CC_KEYCredit card key

Per-tenant credentials configured in the dashboard override these env fallbacks. 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
UPSTASH_REDIS_REST_URLCheckoutapps/checkoutRedis REST endpoint for session storage
UPSTASH_REDIS_REST_TOKENCheckoutapps/checkoutRedis 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.

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_KEYAPI key sent on proxied agent requests; metadata must include organizationId and scopes
AGENT_DEVICE_AUTH_PAGE/device/capabilitiesMerchant approval UI path for device authorization
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)
NEXT_PUBLIC_STOREFRONT_URLStorefront URL for marketing CTAs

Per-app summary

AppCritical vars
storefrontDATABASE_URL, COMMERCE_API_URL, BETTER_AUTH_SECRET, BETTER_AUTH_URL, CHECKOUT_URL, CHECKOUT_API_SECRET, DEFAULT_TENANT_ORG_ID
dashboardDATABASE_URL, COMMERCE_API_URL, BETTER_AUTH_SECRET, NEXT_PUBLIC_AUTH_URL, INTEGRATION_ENCRYPTION_KEY
checkoutUPSTASH_REDIS_*, CHECKOUT_API_SECRET, COMMERCE_API_URL, payment provider keys
apiDATABASE_URL, BETTER_AUTH_*, AUTH_COOKIE_DOMAIN, COMMERCE_CURRENCY, payment/storage provider keys, CHECKOUT_API_SECRET, RESEND_*
adminDATABASE_URL, BETTER_AUTH_SECRET, NEXT_PUBLIC_ADMIN_URL, ADMIN_USER_IDS
docsNone (static site; OpenAPI synced at build time)

Production checklist

  1. Generate strong secrets: BETTER_AUTH_SECRET, CHECKOUT_API_SECRET, INTEGRATION_ENCRYPTION_KEY
  2. Set DEFAULT_TENANT_ORG_ID only for single-tenant deployments; otherwise rely on host resolution
  3. Configure NEXT_PUBLIC_PLATFORM_DOMAIN for subdomain tenants
  4. Provision Upstash Redis for checkout
  5. Set RESEND_API_KEY and a verified-domain RESEND_FROM_EMAIL
  6. Set production payment keys (or configure per-tenant in dashboard)
  7. Point webhook URLs to checkout: /api/webhooks/{stripe\|easypay\|ifthenpay}/{orgId}
  8. Run pnpm db:setup against the production database once

On this page