Configuration Reference

All environment variables and settings for configuring ABAXUS in production.

Database Configuration

VariableRequiredDefaultDescription
DATABASE_URLYesFull PostgreSQL connection string: postgresql://user:pass@host:5432/dbname
DATABASE_MAX_CONNECTIONSNo25Maximum connection pool size. Set to (CPU cores × 2) + effective_io_concurrency
DATABASE_IDLE_TIMEOUTNo600sTime before idle connections are closed
DATABASE_CONNECT_TIMEOUTNo10sTimeout for acquiring a connection from the pool
DATABASE_SSL_MODENorequirePostgreSQL SSL mode: disable, require, verify-ca, verify-full

For production, always use SSL_MODE=verify-full with a valid CA certificate. Disable SSL only in local development.


API Server Configuration

VariableRequiredDefaultDescription
PORTNo8080HTTP port the API server listens on
API_MASTER_KEYYes32+ character random string. Used to derive and validate API keys. Rotate with care — rotation invalidates all existing API keys.
API_RATE_LIMIT_RPMNo6000Global rate limit in requests per minute per API key
API_MAX_BODY_SIZENo1mbMaximum request body size. Increase for large batch event requests (up to 10mb for 1k events).
LOG_LEVELNoinfoLog verbosity: debug, info, warn, error
LOG_FORMATNojsonLog format: json (structured) or text (human-readable for local dev)
CORS_ALLOWED_ORIGINSNoComma-separated list of allowed CORS origins. Required if calling ABAXUS from browser clients.

Payment Provider Credentials

Payment provider credentials are set in the ABAXUS dashboard under Settings → Integrations after initial deployment. They can also be set via environment variables:

Stripe

VariableRequiredDescription
STRIPE_SECRET_KEYConditionalStripe secret key (sk_live_... or sk_test_...)
STRIPE_WEBHOOK_SECRETConditionalWebhook signing secret for verifying Stripe events (whsec_...)
STRIPE_API_VERSIONNoStripe API version to pin to (e.g., 2024-06-20). Defaults to ABAXUS’s tested version.

The Stripe webhook secret is required if you want ABAXUS to receive and process Stripe webhook events (e.g., for confirming async payment intents). Register your ABAXUS webhook endpoint (/v1/webhooks/stripe) in the Stripe Dashboard.

Adyen

VariableRequiredDescription
ADYEN_API_KEYConditionalAdyen API key from the Customer Area
ADYEN_MERCHANT_ACCOUNTConditionalYour Adyen merchant account name
ADYEN_ENVIRONMENTNotest or live (default: live)
ADYEN_LIVE_URL_PREFIXConditionalRequired when ADYEN_ENVIRONMENT=live. Your unique live endpoint prefix from Adyen.
ADYEN_HMAC_KEYConditionalHMAC key for webhook verification

API Key Management

ABAXUS uses two types of API keys:

Secret keys (sk_...): Full API access. Can create, read, update, and delete any resource. Never expose in client-side code. Use for server-to-server communication — your backend services, billing scripts, and admin operations.

Publishable keys (pk_...): Read-only access, limited to entitlement checks and customer-facing usage queries. Safe to embed in browser or mobile clients. Cannot access invoice data, payment method details, or billing configuration.

Create API keys via the ABAXUS dashboard or via POST /v1/api-keys. Keys are shown only once at creation — ABAXUS stores a hashed version. If a key is lost, revoke it and create a new one.


Background Worker Configuration

VariableRequiredDefaultDescription
WORKER_POLL_INTERVALNo60sHow often the worker checks for pending amendments to apply
WORKER_BATCH_SIZENo50Number of amendment records to process per polling cycle
WORKER_EVENT_QUEUE_CONCURRENCYNo10Concurrent event ingestion queue workers
WORKER_INVOICE_JOB_TIMEOUTNo30mMaximum time for a bulk invoice job before it’s marked failed

Redis Configuration (Optional)

VariableRequiredDefaultDescription
REDIS_URLNoRedis connection string: redis://user:pass@host:6379/0. If not set, Redis is not used.
REDIS_ENTITLEMENTS_TTLNo30sTTL for cached entitlement check responses
REDIS_USAGE_SUMMARY_TTLNo60sTTL for cached usage summary responses

Observability

ABAXUS exposes Prometheus metrics at /metrics (requires authentication — use your Prometheus scraper’s API key):

Key metrics exported:

  • abaxus_api_requests_total — total requests by endpoint, method, and status code
  • abaxus_api_request_duration_seconds — request latency histogram
  • abaxus_events_ingested_total — events accepted by the ingestion queue
  • abaxus_events_queue_depth — current depth of the processing queue
  • abaxus_invoice_charge_total — invoice charges by status (success/failure)
  • abaxus_worker_amendment_processing_seconds — amendment processing latency

Configure structured logging with a log aggregator (Loki, Datadog, CloudWatch). ABAXUS emits JSON logs with consistent fields: level, msg, trace_id, customer_id (where applicable), duration_ms, and error (on failures).