Variables

List of configuration variables used in the Temp-Number App.

Notes:

  • As a best practice, separate sensitive variables (API keys, passwords, secrets) into dedicated secret files that are not committed to version control.
  • Add an new line at the end of each file.

Backend Variables

Non-Sensitive Variables

# .backend.env
#############################################################################
# Backend Configuration - Non-Sensitive Settings
#############################################################################
# This file contains non-sensitive configuration that is safe to commit to git
# For sensitive values (passwords, API keys, secrets), see: secrets/backend.secrets
#
# Note: Some values here are overridden during Cloud Run deployment:
#   - DB_HOST → DB_SOCKET_PATH (CloudSQL Unix socket)
#   - NODE_ENV → "production"
#   - HOST → "0.0.0.0"
#############################################################################

#############################################################################
# Application Settings
#############################################################################

TZ=UTC
NODE_ENV=development
PORT=3333
HOST=localhost
LOG_LEVEL=info
ALLOWED_ORIGINS='*'
API_URL_PREFIX='/api'

#############################################################################
# Database Configuration
#
# Note: DB_PASSWORD is stored in secrets/backend.secrets
#############################################################################

DB_HOST=127.0.0.1
DB_PORT=3336
DB_USER=platfone
DB_DATABASE=platfone

#############################################################################
# Platfone Retail API Configuration
#############################################################################

# API URL for Platfone service
# Find URL in dashboard:
#   - Sandbox:    https://platfone.com/test/app/api/
#   - Production: https://platfone.com/app/api/
# Here we use a sandbox (test) API URL as an example
PLATFONE_API_URL=https://temp-number-api.com/test/api/v1

#############################################################################
# Pricing Configuration
#############################################################################

# Percentage markup to apply to base cost (determines profit margin)
CUSTOMER_PRICE_MARKUP=100

# Absolute minimum price (in cents) for any phone number rental
ABSOLUTE_MIN_PRICE=30

# Maximum markup price (in cents) that can be added to the base price
MAX_MARKUP_PRICE=1000

# Additional value (in cents) to add to the price calculation
ADD_VALUE_PRICE=10

# Maximum payment amount in cents (default: 1,000,000 cents = $10,000)
PAYMENT_MAX_AMOUNT=1000000

#############################################################################
# Telegram Authentication
#############################################################################

TELEGRAM_AUTH_ENABLED=false

#############################################################################
# Email Configuration (SMTP)
#
# Settings for sending emails (e.g., contact form, notifications)
#############################################################################

SENDMAIL_ENABLED=false

# Domain for email sender and unsubscribe links
SMTP_DOMAIN=example.com

# SMTP server settings
SMTP_HOST=smtp.ethereal.email
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=username

# Contact form email addresses
CONTACT_FORM_EMAIL_TO=[email protected]
CONTACT_FORM_EMAIL_FROM=[email protected]

#############################################################################
# Google reCAPTCHA Enterprise
#############################################################################

RECAPTCHA_ENABLED=false

# Google Cloud Project ID for reCAPTCHA
RECAPTCHA_PROJECT_ID=your-google-cloud-project-id

# Minimum score threshold for reCAPTCHA validation (0.0 to 1.0)
RECAPTCHA_MIN_SCORE=0.5

#############################################################################
# Payment Gateway: Stripe
#############################################################################

STRIPE_ENABLED=false

# Publishable API key for client-side Stripe integration
STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key_here

# Metadata value to distinguish payments from other sources
STRIPE_METADATA_PAYMENT_SOURCE=platfone

# Block customers who create disputes
STRIPE_BLOCK_DISPUTED_CUSTOMER=true

#############################################################################
# Payment Gateway: App Store (iOS In-App Purchases)
#############################################################################

APPSTORE_ENABLED=false

# Bundle ID for your iOS app (e.g., com.example.app)
APPSTORE_BUNDLE_ID=com.example.app

# Numeric App Store app ID (from App Store Connect)
APPSTORE_APP_ID=1234567890

# Available products as JSON object (product_id: price_in_cents)
# Example: {"one_dollar_purchase": 100, "five_dollar_purchase": 500}
APPSTORE_PRODUCTS='{"one_dollar_purchase": 100, "five_dollar_purchase": 500}'

#############################################################################
# Payment Gateway: Google Play (Android In-App Purchases)
#############################################################################

GOOGLE_PLAY_ENABLED=false

# Package name of your Android app in Google Play
GOOGLE_PLAY_PACKAGE_NAME=com.example.app

# Available products as JSON object (product_id: price_in_cents)
# Example: {"one_dollar_purchase": 100, "five_dollar_purchase": 500}
GOOGLE_PLAY_PRODUCTS='{"one_dollar_purchase": 100, "five_dollar_purchase": 500}'

#############################################################################
# Payment Gateway: PayPal
#############################################################################

PAYPAL_ENABLED=false

# Client ID for your PayPal account
PAYPAL_CLIENT_ID=your_paypal_client_id_here

# PayPal environment: "sandbox" or "production"
PAYPAL_ENVIRONMENT=sandbox

# Webhook ID for PayPal webhook events
PAYPAL_WEBHOOK_ID=your_paypal_webhook_id_here

#############################################################################
# Payment Gateway: Cryptomus (Crypto Payments)
#############################################################################

CRYPTOMUS_ENABLED=false

# Merchant ID for your Cryptomus account
CRYPTOMUS_MERCHANT_ID=your_merchant_id_here

# Callback URL for Cryptomus payment notifications
CRYPTOMUS_CALLBACK_URL=https://your-domain.com/cryptomus-handleWebhookEvents

#############################################################################
# Payment Gateway: Payeer
#############################################################################

PAYEER_ENABLED=false

# Merchant ID for your Payeer account
PAYEER_MERCHANT_ID=your_merchant_id_here

#############################################################################
# Payment Gateway: 0xprocessing
#############################################################################
OXPROCESSING_ENABLED=false

#############################################################################
# Payment Gateway: Binance
#############################################################################

BINANCE_ENABLE=false

# Merchant ID for your Binance account
BINANCE_MERCHANT_ID=your_merchant_id_here

# Public Key for your Binance account
BINANCE_PUBLIC_KEY=your_public_key_here

# Base URL for Binance API
BINANCE_BASE_URL=https://api.binance.com

#############################################################################
# Payment Gateway: Anypay
#############################################################################

ANYPAY_ENABLED=false

# Minimum payment amount in cents
ANYPAY_PAYMENT_MIN_AMOUNT=2500

# Merchant ID for your Anypay account
ANYPAY_MERCHANT_ID=your_merchant_id_here

# Whitelisted IP addresses for Anypay webhook (JSON array)
ANYPAY_WEBHOOK_WHITELISTED_IP='["185.162.128.38", "185.162.128.39", "185.162.128.88"]'

#############################################################################
# Payment Gateway: Wenjishou
#############################################################################

WENJISHOU_ENABLED=false

# Exchange rate for CNY to USD conversion
WENJISHOU_CNY_EXCHANGE_RATE=0.14

#############################################################################
# App Check Configuration
#############################################################################

APP_CHECK_ENABLED=false

#############################################################################
# User Management
#############################################################################

# Maximum number of deleted users with the same email allowed to re-register
DELETED_USER_MAX_COUNT=2

# Rate limit for new auth user attempts (format: "attempts/seconds")
# Example: "5/60" = 5 attempts per 60 seconds
AUTH_THROTTLE_LIMIT=5/60

Sensitive Variables

# .backend.secrets
#############################################################################
# Backend Secrets - Example Template
#############################################################################
# Copy this file to backend.secrets and fill with actual values
# This file contains sensitive information - NEVER commit backend.secrets to git
#
# Instructions:
#   1. Copy: cp backend.secrets.example backend.secrets
#   2. Edit backend.secrets with your actual secret values
#   3. Keep this example file for reference
#############################################################################

#############################################################################
# Database Configuration
#############################################################################

DB_PASSWORD=your_secure_database_password_here

#############################################################################
# Platfone Retail API Configuration
#############################################################################

# API key for the Platfone API
# Find your API key in dashboard:
#   - Sandbox:    https://platfone.com/test/app/api/
#   - Production: https://platfone.com/app/api/
# Ensure the key match the API URL used in PLATFONE_API_URL
PLATFONE_API_KEY=your_PLATFONE_API_key_here

#############################################################################
# Application Security
#############################################################################

# Application encryption key (used for encrypting cookies, sessions, etc.)
APP_KEY=randomly_generated_32_character_string_here

#############################################################################
# Firebase Configuration
#############################################################################

# Path where Firebase service account credentials will be mounted in Cloud Run
# The actual credentials file will be mounted as a secret at this path
# This should match the path expected by your application
GOOGLE_APPLICATION_CREDENTIALS=/app/config/firebase-service-account.json

#############################################################################
# Payment Gateway: Stripe
#############################################################################
# Secret API key for creating Stripe customers and payment intents
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key_here

# Webhook signing secret to verify incoming Stripe webhook messages
STRIPE_WEBHOOK_SECRET=whsec_your_stripe_webhook_secret_here

#############################################################################
# Payment Gateway: PayPal
#############################################################################
# Client Secret for your PayPal account
PAYPAL_CLIENT_SECRET=your_paypal_client_secret_here

#############################################################################
# Payment Gateway: Cryptomus
#############################################################################
# API Key for your Cryptomus account
CRYPTOMUS_API_KEY=your_cryptomus_api_key_here

#############################################################################
# Payment Gateway: Payeer
#############################################################################
# API Key for your Payeer account
PAYEER_API_KEY=your_payeer_api_key_here

#############################################################################
# Payment Gateway: 0xprocessing
#############################################################################
# Webhook password for your 0xprocessing account
OXPROCESSING_WEBHOOK_PASSWORD=your_oxprocessing_webhook_password_here

#############################################################################
# Payment Gateway: Binance
#############################################################################
# API Key for your Binance account
BINANCE_API_KEY=your_binance_api_key_here

# API Secret for your Binance account
BINANCE_API_SECRET=your_binance_api_secret_here

#############################################################################
# Payment Gateway: Anypay
#############################################################################
# Secret Key for your Anypay account
ANYPAY_SECRET_KEY=your_anypay_secret_key_here

#############################################################################
# Payment Gateway: Google Play (Android In-App Purchases)
#############################################################################
# Service account key file content (JSON) with financial data access
# This account needs rights to view/manage financial data in Google Play Console
GOOGLE_PLAY_SECRET_FILE='{"type": "service_account", "project_id": "android", "private_key_id": "android_id", "private_key": "-----BEGIN PRIVATE_ANDROID_KEY-----\n...\n-----END PRIVATE_ANDROID_KEY-----\n"}'

#############################################################################
# Telegram Bot Configuration
#############################################################################
# Telegram Bot Token for notifications and bot functionality
# Get your token from: https://t.me/BotFather
TELEGRAM_BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz1234567890

#############################################################################
# Email Configuration (SMTP)
#############################################################################
# SMTP password for sending emails
SMTP_PASS=your_smtp_password_here

#############################################################################
# Google reCAPTCHA Enterprise
#############################################################################
# reCAPTCHA Site Key (must match the key in GOOGLE_APPLICATION_CREDENTIALS)
# Get your key from: https://console.cloud.google.com/security/recaptcha
RECAPTCHA_SITE_KEY=your_recaptcha_site_key_here

#############################################################################
# Internal Security
#############################################################################

# Hash secret for anonymizing deleted users' emails
HASH_SECRET=your_random_hash_secret_at_least_32_characters_long

Frontend Variables

# .web.env
#############################################################################
# Web Frontend Environment Configuration
#
# All values are baked into the build - no runtime secrets
# These are public values that will be visible in the browser
#
# Note: Some values here are overridden during Cloud Run deployment:
#   - VITE_TEMP_NUMBER_BACKEND_API_BASE_PATH
#   - VITE_TEMP_NUMBER_FRONTEND_BASE_APP_URL
#############################################################################

#############################################################################
# Firebase Configuration
#
# Firebase Console -> Project Settings -> General -> Your apps -> Web App
# If set up with temp-number-deploy scripts, these will be printed during deployment
#############################################################################

VITE_FIREBASE_WEB_API_KEY=AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_APP_ID=1:123456789:web:abcdefghijklmnop

#############################################################################
# API Configuration
#
# Set automatically if deployed by temp-number-deploy scripts
#############################################################################

VITE_TEMP_NUMBER_BACKEND_API_BASE_PATH=https://temp-number-backend.example.com/api/v2

#############################################################################
# Application URLs
#############################################################################
# Base URL of the web application
# Used for constructing links, redirects, etc.
# Set automatically if deployed by temp-number-deploy scripts

VITE_TEMP_NUMBER_FRONTEND_BASE_APP_URL=https://temp-number-web.example.com

#############################################################################
# Payment Gateway Configuration
#############################################################################

VITE_TEMP_NUMBER_WEB_ENABLED_PAYMENT_GATEWAYS=["stripe","paypal","crypto"]

#############################################################################
# External Services
#############################################################################

VITE_TELEGRAM_BOT_ID=your_telegram_bot_id

VITE_RECAPTCHA_ENTERPRISE_ENABLED=0
VITE_RECAPTCHA_ENTERPRISE_SITE_KEY=6LeXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#############################################################################
# CDN URL
#############################################################################

# URL for loading CDN-hosted assets like translations, icons, etc.
VITE_CDN_BASE_URL=https://widget.wl.platfone.com