Skip to content

Environment Variables

Complete inventory of all environment variables, secrets, and configuration used by tripplan.ing.

Worker secrets

Set via Wrangler secrets (pushed by CI):

VariableRequiredDescription
STRIPE_SECRET_KEYFor paymentsStripe API secret key (test or live mode)
STRIPE_WEBHOOK_SECRETFor paymentsStripe webhook endpoint signing secret
MAILGUN_API_KEYFor emailMailgun API key
MAILGUN_DOMAINFor emailMailgun sending domain (e.g., mg.tripplan.ing)
PAYPAL_CLIENT_IDFor PayPalPayPal app client ID (optional)
PAYPAL_CLIENT_SECRETFor PayPalPayPal app secret (optional)
PAYPAL_WEBHOOK_IDFor PayPalPayPal webhook ID (optional)
PAYPAL_SANDBOXFor PayPaltrue for sandbox, false for live (optional)

Worker bindings

Set in wrangler.toml or as Worker environment variables:

VariableRequiredDescription
PLATFORM_OPERATOR_EMAILSYesComma-separated list of platform operator emails
PLATFORM_DOMAIN_SUFFIXYesDefault domain suffix for events (e.g., tripplan.ing)

Cloudflare resource bindings

Configured in wrangler.toml:

BindingTypeDescription
DBD1SQLite database (Drizzle ORM)
KVKV NamespaceSessions, OTP codes, rate limiting
R2R2 BucketPhoto and document storage

GitHub Environment variables

Set as non-secret variables in GitHub Environments:

VariableDescription
CF_ACCOUNT_IDCloudflare account ID
WORKER_NAMEWorker name (e.g., tripplan or tripplan-dev)
D1_DATABASE_IDD1 database UUID
D1_DATABASE_NAMED1 database name
KV_NAMESPACE_IDKV namespace UUID
R2_BUCKET_NAMER2 bucket name
PLATFORM_DOMAIN_SUFFIXDomain suffix for event subdomains
PLATFORM_OPERATOR_EMAILSOperator email list
DOCS_WORKER_NAMEDocs site worker name

GitHub Environment secrets

Set as encrypted secrets in GitHub Environments:

SecretDescription
CF_DEPLOY_API_TOKENCloudflare API token with deploy permissions
STRIPE_SECRET_KEYStripe API key
STRIPE_WEBHOOK_SECRETStripe webhook signing secret
MAILGUN_API_KEYMailgun API key
MAILGUN_DOMAINMailgun domain
PAYPAL_CLIENT_IDPayPal app client ID (optional)
PAYPAL_CLIENT_SECRETPayPal app secret (optional)
PAYPAL_WEBHOOK_IDPayPal webhook ID (optional)
PAYPAL_SANDBOXPayPal sandbox mode flag (optional)

Per-event overrides

These can be set per-event in the settings table to override global values:

Setting fieldOverridesDescription
stripeSecretKeySTRIPE_SECRET_KEYPer-event Stripe account
stripeWebhookSecretSTRIPE_WEBHOOK_SECRETPer-event webhook secret
paypalClientIdPayPal client ID
paypalClientSecretPayPal client secret
paypalWebhookIdPayPal webhook ID
paypalSandboxUse PayPal sandbox mode

Local development

Create a .dev.vars file in the project root:

bash
# Payments (optional for basic dev)
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...

# Email (optional if using dev bypass)
MAILGUN_API_KEY=key-...
MAILGUN_DOMAIN=mg.example.com

# PayPal (optional)
PAYPAL_CLIENT_ID=
PAYPAL_CLIENT_SECRET=
PAYPAL_WEBHOOK_ID=
PAYPAL_SANDBOX=true

# Platform
PLATFORM_OPERATOR_EMAILS=dev@localhost
PLATFORM_DOMAIN_SUFFIX=localhost

# Dev convenience
ENABLE_DEV_BYPASS=true

Dev-only variables

VariableDefaultDescription
ENABLE_DEV_BYPASSfalseSkip authentication in local dev
DATABASE_URLfile:data/local.dbSQLite database path (Docker)
FILES_DIRdata/objectsFile storage directory (Docker)

AppEnv interface

All variables are accessed through the AppEnv interface at runtime:

typescript
interface AppEnv {
  db: Database;
  kv: KvStore;
  blobs: BlobStore;
  STRIPE_SECRET_KEY: string;
  STRIPE_WEBHOOK_SECRET: string;
  PAYPAL_CLIENT_ID: string;
  PAYPAL_CLIENT_SECRET: string;
  PAYPAL_WEBHOOK_ID: string;
  PAYPAL_SANDBOX: string;
  MAILGUN_API_KEY: string;
  MAILGUN_DOMAIN: string;
  PLATFORM_OPERATOR_EMAILS: string;
  PLATFORM_DOMAIN_SUFFIX: string;
}

Released under the MIT License.