Skip to content

Environment Variables Reference

All environment variables used by UberLotto v2. Copy .env.example to .env and fill in the values.

Variable Categories

CategoryPrefixDescription
PublicPUBLIC_*Safe to expose in client bundles
Vite PublicVITE_PUBLIC_*Exposed to client via Vite
PrivateNo prefixServer-only, never exposed to client

Shopify Configuration

Required for all environments.

VariableDescriptionExample
PUBLIC_STOREFRONT_IDShopify Storefront IDgid://shopify/Shop/12345
PUBLIC_STOREFRONT_API_TOKENPublic Storefront API tokenshpat_xxxxx
PUBLIC_STORE_DOMAINStore domainuberlotto.myshopify.com
PRIVATE_STOREFRONT_API_TOKENPrivate Storefront API tokenshpat_xxxxx
PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_IDCustomer Account API client IDshp_xxxxx
PUBLIC_CUSTOMER_ACCOUNT_API_URLCustomer Account API URLhttps://shopify.com/xxxxx
SHOP_IDShop GIDgid://shopify/Shop/12345
SESSION_SECRETSession encryption key (32+ chars)Random string
PUBLIC_CHECKOUT_DOMAINCheckout domainuberlotto.myshopify.com

How to Obtain

  1. Storefront API credentials — Shopify Admin → Settings → Apps → Develop apps → Create/select app → API credentials
  2. Customer Account API — Shopify Admin → Settings → Customer accounts → Enable and configure

Supabase Configuration

Required for database functionality.

VariableDescriptionExample
SUPABASE_URLProject URLhttps://xxxxx.supabase.co
SUPABASE_ANON_KEYAnonymous/public keyeyJhbGciOiJIUzI1NiIs...
SUPABASE_SERVICE_ROLE_KEYService role key (admin)eyJhbGciOiJIUzI1NiIs...

SUPABASE_SERVICE_ROLE_KEY

The service role key bypasses Row Level Security (RLS). Never expose it in client code, logs, or version control. Only use in .server.ts files.

How to Obtain

  1. Open Supabase Dashboard
  2. Select project → Settings → API
  3. Copy keys from "Project API keys" section

Analytics (PostHog)

Optional — leave empty to disable analytics.

VariableDescriptionExample
VITE_PUBLIC_POSTHOG_KEYPostHog project API keyphc_xxxxx
VITE_PUBLIC_POSTHOG_HOSTPostHog host URLhttps://us.i.posthog.com

TIP

Both variables must be set for analytics to work. Leave both empty to disable.

Payment Gateway — Plisio

Required for cryptocurrency payments via Plisio.

VariableDescriptionExample
PLISIO_API_KEYPlisio API keyxxxxx
PLISIO_SECRET_KEYWebhook HMAC secretxxxxx
PLISIO_WEBHOOK_IPSAllowed webhook IPs (comma-separated)216.219.89.38

How to Obtain

  1. Open Plisio Dashboard
  2. API Settings → Create/view API keys
  3. Webhook Settings → Copy secret key

WARNING

PLISIO_SECRET_KEY is used to verify webhook HMAC signatures. PLISIO_WEBHOOK_IPS should include the official Plisio webhook IP: 216.219.89.38.

Payment Gateway — MoonPay

Required for fiat-to-crypto on-ramp payments via MoonPay.

VariableDescriptionExample
MOONPAY_PUBLISHABLE_KEYMoonPay publishable keypk_test_your_key_here
MOONPAY_SECRET_KEYMoonPay secret keysk_test_your_key_here
MOONPAY_WEBHOOK_KEYWebhook HMAC verification keywhk_your_webhook_key_here
MOONPAY_WALLET_ADDRESSDestination wallet address0x3ae230Bc...
MOONPAY_ENVIRONMENTsandbox or productionsandbox

How to Obtain

  1. Open MoonPay Dashboard
  2. Get publishable and secret keys from the API Keys section
  3. Configure webhook key in the Webhooks section

Cleanup Job Authentication

Required for the auto-expire pending transactions cron job.

VariableDescriptionExample
CLEANUP_SECRET_TOKENAuth token for /api/cleanup-pending-transactionsRandom 64-char hex

This token authenticates the cron endpoint that automatically expires pending transactions older than 1 hour. The cron runs every 15 minutes (*/15 * * * *).

How to Generate

bash
# Generate a cryptographically random 64-character token
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

DANGER

Store this token in your password manager and deployment platform. Never commit the actual token to git.

Environment-Specific Setup

Local Development

bash
# .env (gitignored) — copy from .env.example
cp .env.example .env

# .env.local (gitignored) — optional overrides
VITE_PUBLIC_POSTHOG_KEY=  # Disable analytics locally

Production (Shopify Oxygen)

Set environment variables in:

  1. Shopify Admin → Hydrogen → Environment Variables
  2. Or via CLI: shopify hydrogen env push

CI/CD (GitHub Actions)

Set as GitHub Secrets:

  1. Repository → Settings → Secrets and variables → Actions
  2. Add each production variable as a secret

Validation Checklist

Before deploying, verify:

  • [ ] All required Shopify variables are set
  • [ ] SESSION_SECRET is unique per environment
  • [ ] SUPABASE_SERVICE_ROLE_KEY is not exposed in logs
  • [ ] PLISIO_SECRET_KEY matches Plisio dashboard
  • [ ] MOONPAY_WEBHOOK_KEY matches MoonPay dashboard
  • [ ] MOONPAY_ENVIRONMENT is set to production (not sandbox)
  • [ ] CLEANUP_SECRET_TOKEN is secure and stored safely

UberLotto Technical Documentation