Lewati ke konten utama

Environment Configuration

Environments​

EnvBase URLContoh
Developmenthttps://dev-api.bitgroup.asiaLocal testing
Staginghttps://staging-api.bitgroup.asiaQA testing
Productionhttps://api.bitgroup.asiaLive users

Implementasi per Platform​

PlatformMekanisme
AndroidBuild Variants (productFlavors)
iOSXcode Schemes + xcconfig
Flutter--dart-define atau --dart-define-from-file
RN CLI.env files + react-native-config
RN Expoapp.config.ts + EXPO_PUBLIC_* env vars

Rules​

  1. Jangan hardcode base URL atau environment-specific values.
  2. Jangan commit .env file ke repository (masukkan ke .gitignore).
  3. Sediakan .env.example sebagai template.
  4. Environment variable yang berbeda per env:
    • API Base URL
    • API Keys (3rd party)
    • Feature flags
    • Analytics/crash reporting config
    • Log level