This page documents every environment variable that is read by source code in either the (github.com/OFFER-HUB/OFFER-HUB) or the (github.com/OFFER-HUB/offer-hub-monorepo). Every entry is traced to the exact implementation file that reads it.
There are two separate repositories. The Orchestrator is the NestJS payments backend. The documentation site (this website) is a separate Next.js application. Their environment variables are independent and documented in separate sections below.
OFFER-HUB Orchestrator
The Orchestrator is a NestJS monorepo in the OFFER-HUB repository. Copy the example file before editing:
These variables throw at startup or at first use if absent. The application will not function without them.
— Prisma migrations require a direct connection. When using a connection pooler like Supabase's PgBouncer, set DATABASE_URL to the pooler URL (port 6543) and DIRECT_URL to the direct URL (port 5432). For Docker without a pooler, both can be the same value. Verified in packages/database/prisma/schema.prisma:
datasource db { provider = "postgresql" url = env("DATABASE_URL") directUrl = env("DIRECT_URL")}
If this key is lost, all encrypted Stellar private keys become permanently unrecoverable. Store it in a secrets manager — never in version control.
Use rediss:// (double-s) for TLS-encrypted Redis connections in production. The URL is passed directly to ioredis.
The fallback value 'fallback-secret-for-dev' is a public default. Any attacker who knows it can forge short-lived tokens. Verified in apps/api/src/modules/auth/auth.module.ts:
JwtModule.register({ secret: process.env.OFFERHUB_JWT_SECRET || 'fallback-secret-for-dev', signOptions: { expiresIn: '1h' },})
The PaymentProviderModule unconditionally throws an error if PAYMENT_PROVIDER is set to airtm. This is a deliberate guard for an unfinished integration. Use the default crypto value. Verified in apps/api/src/providers/payment/payment-provider.module.ts.
For mainnet deployments, STELLAR_USDC_ISSUER must be set to the correct Circle mainnet issuer address. The default value is the issuer and will not work on mainnet.
For the complete queue, retry, reconciliation, and blockchain-monitor runbook, see Background Jobs and Reconciliation.
PaymentProviderModule throws an error if PAYMENT_PROVIDER=airtm. The AirtmModule and AirtmConfig are loaded unconditionally, which means AIRTM_API_KEY and AIRTM_API_SECRET are validated at startup regardless of PAYMENT_PROVIDER. If these are absent and AirTM is loaded, it throws. In practice: leave PAYMENT_PROVIDER=crypto (default) and set AIRTM_API_KEY and AIRTM_API_SECRET — the API will not start without them.
These variables are read only by the @offerhub/cli package. They are not used by the API server.
If this key is lost, all encrypted Stellar private keys become permanently unrecoverable. Store it in a secrets manager — never in version control. See the Crypto-Native (Stellar) Provider Guide for complete architecture, Horizon monitoring, and production migration steps.
# ─── Server ──────────────────────────────────────────────────────────────────NODE_ENV=developmentPORT=4000 ### AirTM Fiat Endpoints (Optional) <Callout type="warning"> `PAYMENT_PROVIDER=airtm` is **not** supported. `apps/api/src/providers/payment/payment-provider.module.ts` throws `AirTM PaymentProvider is not yet available in this version` during bootstrap, so the API will not start with that value. Leave `PAYMENT_PROVIDER=crypto` (or unset) — the `PaymentProvider` strategy covers the Stellar wallet path only.</Callout> <Callout type="note"> The AirTM top-up, withdrawal and inbound webhook endpoints are a separate concern from `PAYMENT_PROVIDER`. `AirtmModule` is registered unconditionally in `apps/api/src/app.module.ts` and imported by `UsersModule`, `TopUpsModule`, `WithdrawalsModule` and `WebhooksModule`, so `POST /users/:id/airtm/link`, `POST /topups`, `POST /withdrawals` and `POST /webhooks/airtm` are always mounted. They are enabled by the `AIRTM_*` credentials below, not by the payment provider switch. For the full setup — user linking, top-ups, withdrawals, callback redirects, and webhook verification — see the [AirTM Provider Guide](/docs/guide/airtm).</Callout> To use the AirTM fiat endpoints: | Variable | Required | Description ||----------|----------|-------------|| `AIRTM_ENV` | No | `sandbox` (default) or `production` || `AIRTM_API_KEY` | Yes | AirTM API key || `AIRTM_API_SECRET` | Yes | AirTM API secret || `AIRTM_WEBHOOK_SECRET` | Recommended | Svix HMAC secret for webhook verification || `TOPUP_CALLBACK_BASE_URL` | No | Base URL for AirTM top-up confirmation callbacks (default `http://localhost:3000/topups`) || `TOPUP_SUCCESS_REDIRECT_URL` | No | Redirect after a successful top-up (default `http://localhost:3001/topups/success`) || `TOPUP_CANCEL_REDIRECT_URL` | No | Redirect after a canceled/failed top-up (default `http://localhost:3001/topups/canceled`) | <Callout type="warning"> `AIRTM_API_KEY` and `AIRTM_API_SECRET` are required in **every** mode, including `crypto`. `AirtmConfig` validates on instantiation and throws `Missing required Airtm environment variables: ...`, and because `AirtmModule` is always imported the API will not boot without them.</Callout> <Callout type="note"> AirTM requires Enterprise API access. Contact AirTM for credentials. Check that the instance reports AirTM as available with `GET /api/v1/config` — `features.airtm` is `true` only when `AIRTM_API_KEY` is set.</Callout># ─── Database (PostgreSQL) ────────────────────────────────────────────────────# Pooler URL (for runtime queries)DATABASE_URL=postgres://USER:PASSWORD@HOST:6543/postgres?pgbouncer=true# Direct URL (for migrations — must be port 5432, no pooler)DIRECT_URL=postgres://USER:PASSWORD@HOST:5432/postgres # ─── Redis ────────────────────────────────────────────────────────────────────REDIS_URL=redis://localhost:6379 # ─── Authentication ──────────────────────────────────────────────────────────# Generate with: openssl rand -base64 32OFFERHUB_MASTER_KEY=ohk_master_...# Generate with: openssl rand -base64 32OFFERHUB_JWT_SECRET= # ─── Payment Provider ─────────────────────────────────────────────────────────# Only "crypto" is supported. "airtm" throws an error at startup.PAYMENT_PROVIDER=crypto # ─── Wallet Encryption ────────────────────────────────────────────────────────# Required for crypto mode (PAYMENT_PROVIDER=crypto)# Generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"WALLET_ENCRYPTION_KEY= # ─── Trustless Work ───────────────────────────────────────────────────────────# Get credentials from: https://dapp.trustlesswork.comTRUSTLESS_API_KEY=your_api_key_hereTRUSTLESS_WEBHOOK_SECRET=tw_whsec_...# Default: https://api.trustlesswork.com/v1 (production) or https://dev.api.trustlesswork.com (dev)TRUSTLESS_API_URL=https://dev.api.trustlesswork.com# Default: 60000. Must be 1000–120000.TRUSTLESS_TIMEOUT_MS=60000 # ─── Platform Identity ────────────────────────────────────────────────────────# Set by running: npm run bootstrapPLATFORM_USER_ID= # ─── Stellar ──────────────────────────────────────────────────────────────────STELLAR_NETWORK=testnet# Auto-detected from STELLAR_NETWORK if not setSTELLAR_HORIZON_URL=https://horizon-testnet.stellar.orgSTELLAR_USDC_ASSET_CODE=USDC# Testnet Circle issuer (default). Must be updated for mainnet.STELLAR_USDC_ISSUER=GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 # ─── Operations ───────────────────────────────────────────────────────────────# Set to "true" on secondary instances to disable Stellar SSE monitoring# DISABLE_BLOCKCHAIN_MONITOR=true# Set to "false" to skip the CHECK_MISSED_DEPOSITS reconciliation job# RECONCILIATION_ENABLED=false # ─── AirTM (not currently functional — leave commented out) ───────────────────# AIRTM_ENV=sandbox# AIRTM_API_KEY=# AIRTM_API_SECRET=# AIRTM_WEBHOOK_SECRET=# TOPUP_CALLBACK_BASE_URL=http://localhost:3000/topups# TOPUP_SUCCESS_REDIRECT_URL=http://localhost:3001/topups/success# TOPUP_CANCEL_REDIRECT_URL=http://localhost:3001/topups/canceled
Production Readiness Checklist
This checklist is derived from implemented guards and validators in the Orchestrator source code. Items not backed by implementation are not listed.
Items not in this checklist — such as backup infrastructure, external log aggregation, and database snapshots — are not implemented in the Orchestrator source code. Consult your infrastructure provider's documentation for those.
Documentation Site Variables
The documentation site (github.com/OFFER-HUB/offer-hub-monorepo) is a Next.js application. Its environment variables are independent of the Orchestrator.
NEXT_PUBLIC_* variables are embedded into the browser bundle at build time. Never put secrets in them. NEXT_PUBLIC_SUPABASE_ANON_KEY is the Supabase (public) key — it is safe to expose client-side, with row-level security enforcing access control in the database.
src/lib/supabase.ts guards against placeholder values before instantiating the client:
AirTM fiat endpoints (independent of PAYMENT_PROVIDER, which must stay crypto)
AIRTM_ENV=sandbox
AIRTM_API_KEY=
AIRTM_API_SECRET=
AIRTM_WEBHOOK_SECRET=
const looksLikePlaceholder = !rawUrl || rawUrl.includes("your_") || rawUrl.includes("placeholder") || !isValidHttpUrl(rawUrl);
When Supabase is not configured, all of these API routes return HTTP 503:
POST /api/waitlist
POST /api/contact
POST /api/privacy/delete and POST /api/privacy/export (these additionally need SUPABASE_SERVICE_ROLE_KEY, RESEND_API_KEY and MAIL_FROM; apply supabase/migrations/20261020000000_data_rights_tokens.sql for the token table)
The following variables appear in offer-hub-monorepo/.env.example but are not read by any TypeScript or JavaScript source file in that repository.
Next Steps
- Installation — Set up the Orchestrator locally with Docker or the setup wizard
- Getting Started — Architecture overview and first integration steps
- API Reference — Full REST API documentation
- Self-Hosting — Deploy to production infrastructure