Export as

Configuration

Complete reference for all environment variables and configuration options.

OFFER-HUB Orchestrator is configured through environment variables in .env. This page documents every available option.

Quick Start

Copy the example file and fill in your values:

$
cp .env.example .env

Required Variables

These must be set for the application to start:

env
# Server
NODE_ENV=development
PORT=4000

# Database (PostgreSQL)
DATABASE_URL=postgresql://user:password@host:5432/database

# Redis
REDIS_URL=redis://localhost:6379

# Authentication
OFFERHUB_MASTER_KEY=your-secure-master-key

# Payment Provider
PAYMENT_PROVIDER=crypto
WALLET_ENCRYPTION_KEY=your-32-byte-hex-key  # Required for crypto mode

# Trustless Work (Escrow)
TRUSTLESS_API_KEY=your_trustless_api_key

# Stellar
STELLAR_NETWORK=testnet

# Public URL
PUBLIC_BASE_URL=http://localhost:4000

Server Configuration

VariableRequiredDefaultDescription
NODE_ENVYesdevelopmentRuntime environment: development, staging, production
PORTNo4000HTTP server port
LOG_LEVELNoinfoLogging level: debug, info, warn, error

Database (PostgreSQL)

VariableRequiredExampleDescription
DATABASE_URLYespostgresql://user:pass@host:5432/dbPrisma connection string

Examples by Provider

env
# Supabase (use direct connection, port 5432)
DATABASE_URL=postgresql://postgres:password@db.xxxx.supabase.co:5432/postgres?sslmode=require

# Railway
DATABASE_URL=postgresql://postgres:password@containers-us-west-xxx.railway.app:5432/railway

# Neon
DATABASE_URL=postgresql://user:password@ep-xxx.us-east-2.aws.neon.tech/neondb?sslmode=require

# Local Docker
DATABASE_URL=postgresql://offerhub:offerhub_password@localhost:5432/offerhub_db
Warning

When using Supabase, always use the direct connection URL (port 5432), not the pooler (port 6543). Prisma migrations require the direct connection.

Redis

VariableRequiredExampleDescription
REDIS_URLYesredis://:pass@host:6379Redis connection string

What Redis is Used For

FeatureDescription
BullMQBackground job queues and processing
Rate LimitingAPI request throttling
IdempotencyDuplicate request prevention
CachingPerformance optimization

Examples by Provider

env
# Upstash
REDIS_URL=redis://default:xxx@us1-xxx.upstash.io:6379

# Railway
REDIS_URL=redis://default:xxx@containers-us-west-xxx.railway.app:6379

# Local Docker
REDIS_URL=redis://localhost:6379

Authentication

VariableRequiredExampleDescription
OFFERHUB_MASTER_KEYYesohk_master_xxxMaster key for creating API keys

Generating a Secure Master Key

bash
# Generate 32-byte random key
openssl rand -base64 32

# Or use Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"

Payment Provider

VariableRequiredDefaultDescription
PAYMENT_PROVIDERNocryptoPayment mode: crypto or airtm

Crypto-Native Mode (Default)

When PAYMENT_PROVIDER=crypto:

VariableRequiredDescription
WALLET_ENCRYPTION_KEYYes64 hex characters - AES-256-GCM key for encrypting Stellar private keys

Generating WALLET_ENCRYPTION_KEY

$
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Danger

This key protects all user wallet private keys. If lost, wallet access is permanently lost. Store securely and back up.

AirTM Mode (Optional)

Warning

Not Currently Functional — AirTM integration is not available at this time. This section is for reference only. Use PAYMENT_PROVIDER=crypto (the default) for production deployments.

When PAYMENT_PROVIDER=airtm:

VariableRequiredDescription
AIRTM_ENVYessandbox or prod
AIRTM_API_KEYYesAirTM API key
AIRTM_API_SECRETYesAirTM API secret
AIRTM_WEBHOOK_SECRETRecommendedHMAC secret for webhook verification
Note

AirTM requires Enterprise API access. Contact AirTM for credentials.

Trustless Work (Escrow)

VariableRequiredDescription
TRUSTLESS_API_KEYYesTrustless Work API key
TRUSTLESS_WEBHOOK_SECRETRecommendedHMAC secret for webhook verification
TRUSTLESS_API_URLNoOverride API base URL (auto-detected by default)
PLATFORM_USER_IDYesPlatform user ID for escrow operations

Get credentials at trustlesswork.com.

Stellar Network

VariableRequiredDefaultDescription
STELLAR_NETWORKNotestnetStellar network: testnet or mainnet
STELLAR_HORIZON_URLNoAutoHorizon server URL
STELLAR_USDC_ASSET_CODENoUSDCUSDC asset code
STELLAR_USDC_ISSUERYesSee belowUSDC issuer address

Network Details

NetworkHorizon URLUSDC Issuer
testnethttps://horizon-testnet.stellar.orgGBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5
mainnethttps://horizon.stellar.orgGA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN
Note

Use testnet for development and testing. Switch to mainnet for production.

Public URL

VariableRequiredDescription
PUBLIC_BASE_URLYesYour Orchestrator's public URL (for webhooks and callbacks)

Frontend Variables

For the Next.js frontend, prefix with NEXT_PUBLIC_:

env
NEXT_PUBLIC_API_URL=http://localhost:4000
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
NEXT_PUBLIC_SITE_URL=https://offer-hub.tech

Complete .env Template

Copy this for a complete setup:

env
# Server
NODE_ENV=development
PORT=4000
LOG_LEVEL=debug

# Database (PostgreSQL)
DATABASE_URL=postgresql://offerhub:offerhub_password@localhost:5432/offerhub_db

# Redis
REDIS_URL=redis://localhost:6379

# Authentication
OFFERHUB_MASTER_KEY=change-me-in-production

# Payment Provider
PAYMENT_PROVIDER=crypto
WALLET_ENCRYPTION_KEY=  # Generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

# AirTM (only if PAYMENT_PROVIDER=airtm)
# AIRTM_ENV=sandbox
# AIRTM_API_KEY=
# AIRTM_API_SECRET=
# AIRTM_WEBHOOK_SECRET=

# Trustless Work
TRUSTLESS_API_KEY=
TRUSTLESS_WEBHOOK_SECRET=

# Platform Identity
PLATFORM_USER_ID=

# Stellar
STELLAR_NETWORK=testnet
STELLAR_USDC_ISSUER=GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5

# Public URL
PUBLIC_BASE_URL=http://localhost:4000

Security Best Practices

  1. Never commit .env files - Add to .gitignore
  2. Use different keys per environment - Dev, staging, prod should have separate credentials
  3. Rotate keys periodically - Especially OFFERHUB_MASTER_KEY
  4. Use TLS for Redis - Use rediss:// in production
  5. Require SSL for database - Use ?sslmode=require
  6. Store secrets in vault - Use platform secrets (Railway, Render) or HashiCorp Vault
Danger

Never commit your .env file to version control. It is already listed in .gitignore.

Next Steps