Browse guides
Setup
Checklist of everything to prepare before deploying betterrewards: environment variables, onboarding wizard parameters, DNS, email, Stripe, and payout accounts.
5 min read · For companies
Gathering your environment variables, onboarding details, and third-party accounts up front turns deployment and first-run setup into a 20-minute checklist instead of stopping mid-way to hunt for credentials. Use this page before following Deploy with Docker, Deploy on Vercel, or Deploy on Cloudflare.
Just trying betterrewards locally on your laptop? Skip this list and jump straight to the local trial at the top of Deploy with Docker — it needs only Docker Desktop.
1. Environment variables to prepare for installation
Secrets and infrastructure settings live in environment variables (never hardcoded in the repo). Prepare the required variables below before starting your server or clicking Deploy.
Required environment variables
| Variable | Purpose & format | Where it applies |
|---|---|---|
| APP_URL | Public HTTPS URL of your dashboard and partner portal, e.g. https://rewards.example.com. | Docker (required); auto-derived on Vercel and Cloudflare. |
| AUTH_SECRET | Random 32+ byte secret (openssl rand -base64 32). Signs sessions and encrypts stored Stripe, payout API, and network keys with AES-256-GCM. | All deployments. |
| DATABASE_URL (or POSTGRES_*) | PostgreSQL 17 connection string. Docker Compose builds DATABASE_URL from POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB automatically. | Vercel / Cloudflare (Neon or any Postgres); Docker sets defaults automatically. |
| EMAIL_FROM | Sender address for magic-link sign-in and notifications, e.g. Rewards <rewards@example.com> on a domain you control. | All deployments. |
| EMAIL_TRANSPORT + SMTP_* or RESEND_API_KEY | How emails are sent (sign-in has no passwords). Use smtp (SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD), resend (RESEND_API_KEY), or cloudflare (Cloudflare Email Service). | All deployments (at least one transport is required). |
| OWNER_EMAIL | Email address that automatically becomes the instance owner on first sign-in. On Docker you can run create-owner via CLI instead. | Vercel and Cloudflare one-click deploys (optional on Docker). |
| CRON_SECRET | Random 32+ byte secret (openssl rand -hex 32) authenticating scheduled calls to /api/cron/tick. | Vercel serverless only (Docker uses the worker container; Cloudflare uses Cron Triggers). |
Optional environment variables
| Variable | When to set it |
|---|---|
| TRACKING_DOMAIN | Optional bare hostname (no https://), e.g. go.example.com, if you want branded short referral links like https://go.example.com/anna. |
| GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET | Optional Google OAuth sign-in alongside email magic links (callback URL: <APP_URL>/api/auth/google/callback). |
| CADDY_SITES / TRUST_PROXY / TRUST_PROXY_HOPS | Docker HTTPS profile only: list your dashboard (and optional tracking) hostnames in CADDY_SITES and set TRUST_PROXY=true when behind a reverse proxy. |
| STRIPE_API_KEY / STRIPE_WEBHOOK_SECRET | Optional in .env. Most owners leave these blank and connect Stripe from the onboarding wizard UI (which stores the key encrypted and creates the webhook automatically). Set in .env only for IaC overrides. |
| PAYPAL_* / WISE_* | Optional in .env (PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PAYPAL_MODE, WISE_API_TOKEN, WISE_PROFILE_ID, WISE_SOURCE_CURRENCY, WISE_SCA_PRIVATE_KEY). Most owners configure payout channels in the onboarding wizard UI instead. |
| NETWORK_PRIVATE_KEY | Optional IaC-only Ed25519 key for connecting to betterrewards.network. Most owners skip this and use the one-click OAuth button in Onboarding or Integrations → Network. There is no network URL to configure: betterrewards always connects to https://app.betterrewards.network. |
| PREVIOUS_AUTH_SECRET | Only needed temporarily while rotating AUTH_SECRET so existing encrypted credentials remain readable. |
2. Parameters to prepare for the onboarding wizard
When you sign in as the owner for the first time, betterrewards opens a 6-step setup wizard (Brand → Stripe → Program → Install → Payouts → Launch). Having these decisions and credentials ready lets you finish in one pass:
| Wizard step | Parameters & assets to prepare |
|---|---|
| 1. Brand | Business name, main website URL, square PNG/JPG logo (at least 80×80 px; avoid SVG because most email clients block it), short company summary, optional partner agreement text, minimum payout per currency (e.g. usd=50), and monthly payout day. |
| 2. Stripe | Admin access to your Stripe account (live or test mode) to create a restricted key (rk_live_… or rk_test_…). The wizard opens Stripe with permissions pre-selected. If you prefer not to grant Webhook Endpoints write access, prepare to paste the webhook signing secret (whsec_…) manually. |
| 3. Program | Program name, immutable join link slug (e.g. acme-pro), landing page URL, commission model (percentage or flat amount), duration (first payment, N months, or lifetime), hold period in days (typically 14–30 days to cover refunds), attribution window in days (typically 30–60 days), optional customer discount coupon, eligible Stripe products, and partner talking points/assets. |
| 4. Install tracking | Write access to your website's <head> template to add <script async src="https://<APP_URL>/v1/br.js"></script>, plus access to your backend Stripe checkout code to forward the br_click cookie into client_reference_id and metadata.br_click_id. If your marketing site and checkout app live on different domains or you are migrating from another tracker, list those outbound domains and legacy query parameter names. |
| 5. Payouts (optional) | Decide whether to start with manual CSV payouts (skip this step) or connect API payouts now: PayPal Payouts API needs a Business app Client ID, Client Secret, and optional Webhook ID; Wise Business API needs a Full Access API Token, Business Profile ID, source currency, and an RSA-2048 SCA public/private key pair (which you can generate right in the UI and upload to Wise Business Settings). |
| 6. Launch | Optional list of initial partner emails to invite right away, and whether to click Connect with OAuth to list your active programs on https://app.betterrewards.network. |
3. Other operational & compliance items to prepare
Beyond environment variables and wizard fields, check these items before inviting real partners or going live:
- DNS control: access to add A / CNAME records for your dashboard subdomain (e.g. rewards.example.com) and optional short-link host (e.g. go.example.com). On Cloudflare DNS with Docker/Caddy, keep records set to DNS only (grey cloud) so the server can issue TLS certificates.
- Email deliverability: verify your sending domain with your SMTP provider or Resend and publish SPF, DKIM, and DMARC records so partner magic-link sign-in emails do not land in spam.
- Stripe business readiness: decide whether to validate end-to-end first using a Stripe test-mode key (rk_test_…) or connect live directly. Remember that Stripe coupons are immutable once created, so finalize your discount percentage and eligible products before publishing a program with a discount.
- Payout account approval & funding: PayPal live Payouts API requires PayPal Business approval (request Payouts access in the PayPal Developer Dashboard before launch). Wise Business live transfers require a funded multi-currency balance and, in most regions, registering your RSA SCA public key in Wise Business Settings → API tokens.
- Domain verification for betterrewards.network: if you plan to list publicly on https://app.betterrewards.network, make sure you can add a DNS TXT record (_betterrewards-network.yourdomain.com) or host /.well-known/betterrewards-network.txt on your product's landing domain.
- Partner terms & tax process: prepare your affiliate terms (brand bidding rules, disclosure expectations, prohibited channels) and decide how your finance team collects partner tax forms or invoices (such as W-9, W-8BEN, or VAT invoices), since betterrewards tracks commissions and payouts rather than filing taxes.
Ready to deploy? Continue to Deploy with Docker (own VPS), Deploy on Vercel, or Deploy on Cloudflare.