Skip to content

Environment Configuration

Bridge Payments is configured through environment variables managed in the Pubflow Platform dashboard.

Accessing Configuration

  1. Log in to Pubflow Platform
  2. Navigate to your Bridge Payments instance
  3. Go to ConfigurationEnvironment Variables
  4. Add or edit variables
  5. Click Save Configuration

Changes are applied automatically without requiring a restart.

Core Configuration

Database

bash
# Database connection (required)
DATABASE_URL=postgresql://user:password@host:5432/database

# Supported databases:
# - PostgreSQL: postgresql://...
# - MySQL: mysql://...
# - SQLite: sqlite://path/to/db.sqlite
# - LibSQL: libsql://...
# - Neon: postgresql://[email protected]/...
# - PlanetScale: mysql://[email protected]/...

Flowless Integration

bash
# Flowless API URL (required)
FLOWLESS_API_URL=https://your-flowless.pubflow.com

# Bridge validation secret (required)
# Must match the secret in your Flowless instance
BRIDGE_VALIDATION_SECRET=your_shared_secret_here

# Authentication timeout (optional, default: 30000ms)
AUTH_TIMEOUT=30000

# Request timeout (optional, default: 60000ms)
REQUEST_TIMEOUT=60000

Shared Secret

The BRIDGE_VALIDATION_SECRET must be identical in both Bridge Payments and Flowless instances for session validation to work.

Payment Providers

Stripe

bash
# Stripe secret key (required for Stripe)
STRIPE_SECRET_KEY=sk_test_...

# Stripe publishable key (optional, for frontend)
STRIPE_PUBLISHABLE_KEY=pk_test_...

# Stripe webhook secret (required for webhooks)
STRIPE_WEBHOOK_SECRET=whsec_...

PayPal

bash
# PayPal client ID (required for PayPal)
PAYPAL_CLIENT_ID=your_client_id

# PayPal client secret (required for PayPal)
PAYPAL_CLIENT_SECRET=your_client_secret

# PayPal mode (optional, default: sandbox)
PAYPAL_MODE=sandbox  # or 'live' for production

# PayPal webhook ID (required for webhooks)
PAYPAL_WEBHOOK_ID=your_webhook_id

Get PayPal Credentials

  • Developer Dashboard: PayPal Developer
  • Create App: Dashboard → My Apps & Credentials → Create App

Authorize.net

bash
# Authorize.net API login ID (required)
AUTHORIZE_NET_API_LOGIN_ID=your_api_login_id

# Authorize.net transaction key (required)
AUTHORIZE_NET_TRANSACTION_KEY=your_transaction_key

# Authorize.net mode (optional, default: sandbox)
AUTHORIZE_NET_MODE=sandbox  # or 'production'

# Authorize.net signature key (required for webhooks)
AUTHORIZE_NET_SIGNATURE_KEY=your_signature_key

Guest Checkout

bash
# Enable guest checkout (optional, default: true)
GUEST_CHECKOUT_ENABLED=true

# Require email for guest checkout (optional, default: true)
GUEST_REQUIRE_EMAIL=true

# Guest token expiration (optional, default: 3600 seconds)
GUEST_TOKEN_EXPIRATION=3600

Response Format

bash
# Enable row mode (optional, default: false)
# When true, responses use object format with ID as key
ROW_MODE=false

Standard Format (ROW_MODE=false):

json
{
  "id": "pay_123",
  "amount_cents": 2000
}

Row Mode (ROW_MODE=true):

json
{
  "pay_123": {
    "amount_cents": 2000
  }
}

Caching

bash
# Cache TTL in seconds (optional, default: 300)
CACHE_TTL=300

# Cache max size (optional, default: 1000)
CACHE_MAX_SIZE=1000

Logging

bash
# Log mode (optional, default: production)
LOG_MODE=development  # or 'production'

# Log level (optional, default: info)
LOG_LEVEL=info  # debug, info, warn, error

Security

bash
# CORS allowed origins (optional, comma-separated)
CORS_ORIGINS=https://yourapp.com,https://www.yourapp.com

# Rate limit (optional, default: 100 requests per minute)
RATE_LIMIT=100

# Rate limit window (optional, default: 60000ms)
RATE_LIMIT_WINDOW=60000

External Webhooks

See External Webhooks Guide for detailed configuration.

bash
# Enable external webhooks (optional, default: false)
EXTERNAL_WEBHOOKS_ENABLED=true

# Webhook debug mode (optional, default: false)
WEBHOOK_DEBUG_MODE=true

# Configure webhooks (numbered 1, 2, 3, ...)
WEBHOOK_1_NAME=discord_alerts
WEBHOOK_1_URL=https://discord.com/api/webhooks/...
WEBHOOK_1_EVENTS=payment.failed,subscription.cancelled
WEBHOOK_1_SECRET=optional_secret_for_signature

Next Steps