Env Vars · ThisOrThat

ThisOrThat environment variables

ToT is the buyer-facing marketplace where Flip and Pull plays happen. Every var listed here is referenced at runtime — missing ones either crash loud (e.g. ship-from address) or silently degrade (e.g. provably-fair anchoring falls back to local hashing without Solana).

Database + Auth

VariableTypeWhat it unlocks
DATABASE_URLRequiredPostgres connection string (separate from SlabTrack's DB).
JWT_SECRETRequiredMust match SlabTrack. Without this match, the SSO handoff from SlabTrack → ToT silently fails.
NEXTAUTH_SECRETOptionalLegacy NextAuth secret — still referenced in some helpers. Set to same value as JWT_SECRET if you don't have a separate one.

Stripe Required

ToT uses direct charges on the platform account (not Connect). All buyer payments flow into your single Stripe account; payouts handled by Stripe's normal payout schedule.

VariableTypeWhat it unlocks
STRIPE_SECRET_KEYSecretServer-side API calls. Use sk_test_ in dev, sk_live_ in prod.
STRIPE_PUBLISHABLE_KEYPublicClient-side Stripe.js init. pk_test_ / pk_live_.
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYPublicSame value, exposed to the browser via Next's NEXT_PUBLIC_ prefix.
STRIPE_WEBHOOK_SECRETSecretValidates inbound webhook signatures at /api/stripe/webhook. Without it, every webhook 401s and Pull/Flip plays never settle. whsec_...
⚠ Webhook secret rotates per environment

Stripe issues a different whsec_ for each webhook endpoint you create. Test mode endpoint = test secret. Live mode endpoint = live secret. When you flip from test to live, you must also update STRIPE_WEBHOOK_SECRET on Railway.

Shippo Required

VariableTypeWhat it unlocks
SHIPPO_API_TOKEN Secret USPS label printing via Shippo. shippo_test_ in dev, shippo_live_ in prod.
SHIPPO_API_KEY Legacy Old name — code falls back to this if SHIPPO_API_TOKEN isn't set. Use SHIPPO_API_TOKEN for new deploys.

Ship-from address All required

ToT uses a single ship-from address (one operator running the marketplace). These are read fresh per label-purchase request — change them in Railway and the next label uses the new address (no restart needed).

VariableExampleWhat it unlocks
SHIP_FROM_NAMEYour Shop LLC"From" name on the USPS label.
SHIP_FROM_STREET1301 Justin Rd Ste 201Street + suite. Single line.
SHIP_FROM_CITYLewisvilleCity.
SHIP_FROM_STATETX2-letter state code.
SHIP_FROM_ZIP750775-digit ZIP.
SHIP_FROM_PHONE469123456710-digit phone, no formatting. USPS requires this.
ADMIN_EMAILops@yourdomain.comEmail on the from-address. Defaults to support@slabtrack.io if unset.
⚠ Missing any of these = labels fail

The shipping endpoint throws "Ship-from address not configured" with the list of missing vars. Previously it would silently ship from a blank address with the name "ThisOrThat" — that's been fixed, but the lesson stands: set all six (plus ADMIN_EMAIL) before going live.

Public URL

VariableTypeWhat it unlocks
NEXT_PUBLIC_BASE_URL Public Used in cross-origin links (refund email URLs, share links). Production: https://thisorthat.slabtrack.io.

SlabTrack ecosystem

VariableTypeWhat it unlocks
SLABTRACK_API_URL Required Where ToT pulls comp data + identity. Production: https://www.slabtrack.io.
SLABTRACK_TOKEN Secret Service token for outbound API calls back to SlabTrack (sale events, comp lookups).
ECOSYSTEM_WEBHOOK_SECRET Secret Validates inbound webhooks from SlabTrack. Must match SlabTrack's value.

Solana (provably-fair anchoring)

Every Pull / Flip outcome's seed gets anchored on Solana before the winner is computed. Buyers can verify the result independently. Optional but strongly recommended for trust.

VariableTypeWhat it unlocks
SOLANA_RPC_URL Optional Solana RPC endpoint. Devnet: https://api.devnet.solana.com, Mainnet: https://api.mainnet-beta.solana.com.
SOLANA_PRIVATE_KEY Secret Base58 keypair for the anchor wallet. Needs SOL on the matching network to pay anchoring fees (~$0.0001 per play on mainnet).

Optional

VariableTypeWhat it unlocks
HUDDLE_API_URLOptionalLive game odds for Game-Day plays. Without it, GameDay listings are read-only.
HUDDLE_API_KEYOptionalAuth for the Huddle API.
ANTHROPIC_API_KEYOptionalAI-assisted ad copy generation + buyer-facing card descriptions.
NEXT_PUBLIC_DEV_MODEOptional"true" shows the purple DEV banner + uses demo-coin payments. Always "false" in prod.

Production checklist