# Variables the app reads through `env` must also be declared in src/env/schema.mjs # (serverSchema/serverEnv) or src/env/clientSchema.mjs (clientSchema/clientEnv). Variables read by SDKs (UPSTASH_*, # UPLOADTHING_TOKEN), by tooling (MYSQL_URL) or from process.env at call time (CRON_SECRET, # APPLE_SIGN_IN_*) are only listed here. # Environment NODE_ENV=development NEXT_PUBLIC_BASE_URL=http://127.0.0.1:3000 # Server-only HTTPS destination for anonymous consent receipts. Configure before rollout. # CONSENT_RECEIPTS_URL=https://collector.example.com/receipts # Optional browser marketing pixel. Set only in Production; unset disables Meta tracking. # Public dataset ID for TheNinja-RPG — Website. Requires explicit marketing consent. # NEXT_PUBLIC_META_PIXEL_ID=4625815744371142 # Optional public welcome design. Unset preserves the current welcome page. # Visitors can override the welcome default in Settings > Display. # NEXT_PUBLIC_WELCOME_LAYOUT=20-eclipse-observatory # Local planetscale (here local mysql behind proxy) DATABASE_URL='http://tnr:placeholder@127.0.0.1:3002/tnr' MYSQL_URL='mysql://tnr:placeholder@127.0.0.1:3307/tnr' DEV_DATABASE_URL='http://tnr:placeholder@127.0.0.1:3002/tnr' # Clerk.dev Auth (Required - sign up on https://clerk.com/) NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=placeholder CLERK_SECRET_KEY=placeholder # Optional multiline PEM public key from the same Clerk instance's API Keys page. # Verify on a preview before enabling. Update and redeploy when rotating signing keys; # a wrong/stale key rejects authentication. Leave unset to use Clerk's remote JWKS. CLERK_JWT_KEY= # Enable after deploying /__clerk and verifying its proxy URL in Clerk Domains. # Keeps native authentication refresh on the game origin; ordinary web clients use DNS. NATIVE_CLERK_PROXY_ENABLED=false # Vercel BotID on tRPC mutations. Unset blocks detected bots in production only; # false records detections without blocking (kill switch); true also blocks on previews. # Local development never blocks: BotID answers "human" outside Vercel. # BOTID_ENFORCE=false # Optional Block Struggle mini-game bridge (server-only; set all four together). # BLOCKSTRUGGLE_TRUSTED_VERCEL_SOURCE is optional. # The RPG origin must exactly match this deployment's browser Origin and the # Block Struggle API's NINJA_ALLOWED_ORIGINS and NINJA_AUTH_AUTHORIZED_PARTIES. # The RPG Clerk session JWT audience must match NINJA_AUTH_AUDIENCE. # Generate a fresh cookie key with: openssl rand -base64 32 | tr '+/' '-_' | tr -d '=' # BLOCKSTRUGGLE_API_ORIGIN=https://your-blockstruggle-api.example # BLOCKSTRUGGLE_RPG_ORIGIN=https://www.theninja-rpg.com # BLOCKSTRUGGLE_BRIDGE_COOKIE_KEY=generated-32-byte-base64url-key # BLOCKSTRUGGLE_CLERK_JWT_TEMPLATE=blockstruggle_ninja # Enable only when BlockStruggle trusts this Vercel project's Preview OIDC tokens. # BLOCKSTRUGGLE_TRUSTED_VERCEL_SOURCE=true # Enable only after the shared puzzle schema, API flag and both Clerk # connections have passed cross-host linking QA. NEXT_PUBLIC_BLOCKSTRUGGLE_IDENTITY_LINK_ENABLED=false # Websockets (here local soketi instance) PUSHER_APP_ID=app-id PUSHER_APP_SECRET=app-secret NEXT_PUBLIC_PUSHER_APP_KEY=app-key NEXT_PUBLIC_PUSHER_APP_CLUSTER="us2" # Upstash (here local redis behind proxy) UPSTASH_REDIS_REST_URL="https://127.0.0.1:3003" UPSTASH_REDIS_REST_TOKEN="placeholder" # Replicate API (optional) REPLICATE_API_TOKEN=placeholder # Server-only key for the staff sprite studio (full access, from gameasset.dev/developers) GAMEASSET_API_KEY= # Uploadthing (optional) UPLOADTHING_TOKEN=placeholder #OpenAI API (Required) OPENAI_API_KEY=placeholder # GitHub API (optional - for support ticket escalation) GITHUB_ISSUE_TOKEN=placeholder GITHUB_WEBHOOK_SECRET=placeholder # Signing secret from TopRankinGames > Reward voters; server-only. # Configure the callback as https://www.theninja-rpg.com/api/webhooks/toprankingames TOPRANKINGAMES_WEBHOOK_SECRET= # Callback secret from Shinobi Rank > My listings > Integration; server-only. # Use Signed POST with https://www.theninja-rpg.com/api/webhooks/shinobirank SHINOBIRANK_WEBHOOK_SECRET= # Callback secret from Web Game Charts > My listings > Integration; server-only. # Use Signed POST with https://www.theninja-rpg.com/api/webhooks/webgamecharts WEBGAMECHARTS_WEBHOOK_SECRET= # For redis to work in local development NODE_TLS_REJECT_UNAUTHORIZED=0 # AI test-user broker (optional - enables /api/ai-test-user provisioning in local dev / Vercel preview). # Leave empty here: set a real secret in your local .env or preview environment vars. AI_TEST_USER_BROKER_TOKEN= # Required on each deployment running scheduled jobs; Vercel sends it as a Bearer token. CRON_SECRET= # Key for the IP hashes in visitor analytics. Required in production; never rotate it, since # rows hashed under the old key stop joining. IP_HASH_SECRET= # Permanent native account deletion. Enable only after migration and integration QA. NATIVE_ACCOUNT_DELETION_ENABLED=false # Sign in with Apple key (not the APNs or purchases key); match native App ID. APPLE_SIGN_IN_CLIENT_ID=com.theninjarpg.app # Services ID configured for Clerk browser OAuth (including Android). APPLE_SIGN_IN_SERVICES_ID=com.theninjarpg.clerk APPLE_SIGN_IN_TEAM_ID= APPLE_SIGN_IN_KEY_ID= APPLE_SIGN_IN_PRIVATE_KEY= # RevenueCat secret API v1 key for customer deletion, never a public SDK key. REVENUECAT_SECRET_API_KEY= # Accounts whose sandbox purchases still grant, comma separated. Set this to the App Review # demo account before submitting -- TestFlight and review always transact in the sandbox -- # and clear it afterwards. # STORE_SANDBOX_USER_IDS= # Pull zone in front of production assets; unset serves them from the app itself. CDN_URL= # Hosted Stripe Checkout (server only). Live keys in Production, sandbox keys in Development/Preview. STRIPE_SECRET_KEY= STRIPE_WEBHOOK_SECRET= STRIPE_PRICE_NORMAL= STRIPE_PRICE_SILVER= STRIPE_PRICE_GOLD= STRIPE_PRICE_DIAMOND= # Headless Shopify merch (server-only; optional until the collection is connected) SHOPIFY_STORE_DOMAIN= SHOPIFY_STOREFRONT_ACCESS_TOKEN= MERCH_CHECKOUT_ENABLED=false # Discord account linking with Linked Roles (server-only; see docs/DiscordLinking.md) DISCORD_LINKING_ENABLED=false DISCORD_CLIENT_ID= DISCORD_CLIENT_SECRET= DISCORD_BOT_TOKEN= DISCORD_GUILD_ID= DISCORD_VERIFIED_ROLE_ID= DISCORD_VILLAGE_ROLE_IDS= DISCORD_RANK_ROLE_IDS= DISCORD_TOKEN_ENCRYPTION_KEY= # Optional Discord event alerts (docs/DiscordEventAlerts.md). Select roles in Discord. DISCORD_EVENT_UPDATES= DISCORD_RAIDS_ROLE_ID= DISCORD_WARS_ROLE_ID= DISCORD_TERRITORY_WARS_ROLE_ID= # Enable only after the consent PR is deployed; token is server-only, never public. META_CAPI_ENABLED=false META_CAPI_ACCESS_TOKEN=