packages/config/src/env.ts is the only runtime environment access layer. It reads explicit EXPO_PUBLIC_* names, validates them with Zod, caches the result, and exports env plus helper functions.
Firebase client keys, OAuth client IDs, RevenueCat public SDK keys, and a OneSignal app ID identify client applications; restrict them in their provider dashboards where supported. Keep privileged operations and secrets on a backend.
Supported variables
Boolean variables are strings. Only the exact value
true becomes true; every other provided string becomes false.
Local development
The repository includes.env.example. Create a gitignored .env.local at the repository root and restart Metro after changes:
.env.local
localhost when your API runs on your computer.
Manage values in EAS
Run EAS commands fromapps/mobile, where eas.json and the linked Expo project live. Create the same variable name separately for each EAS environment:
plaintext or sensitive visibility for values needed while bundling client code. Do not use secret visibility as a security mechanism for EXPO_PUBLIC_* values.
List, pull, and delete values with the current EAS environment commands:
bun run env runs the mobile eas env:pull target and moves the generated .env.local to the repository root. The EAS CLI may prompt you to select an environment.
Each current build profile sets its EAS environment in apps/mobile/eas.json, so builds receive the matching remote values. Avoid duplicating public values in profile-level env blocks unless you intentionally want values committed to source.
Adapter requirements
- Firebase native services: provide the matching native plist/JSON files. The six
EXPO_PUBLIC_FIREBASE_*client fields are used only when startup needs to initialize a Firebase app from options; that fallback requires API key, app ID, project ID, and messaging sender ID together. - Firebase email verification: set
EXPO_PUBLIC_FIREBASE_EMAIL_CONTINUE_URL; optionally setEXPO_PUBLIC_FIREBASE_AUTH_LINK_DOMAIN. - Google sign-in: set
EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID; optionally set the iOS client ID. - RevenueCat: set the shared key or the key for each target platform. The shared key wins when both forms are present.
- OneSignal: set
EXPO_PUBLIC_ONE_SIGNAL_APP_IDwhennotifications.adapterisonesignal. - Mock adapters: require no provider values.
Add a variable
Add every new client variable to both the Zod schema and the explicitraw object in packages/config/src/env.ts. Import it from @amisi-mobile-starter/config; do not read process.env in another package. Update .env.example and every relevant EAS environment.