App environment variables (Expo)
Local `.env.local` workflow for build-time `EXPO_PUBLIC_*` flags.
The Happier app (apps/ui) uses Expo. Expo supports loading .env* files for local development and then inlining EXPO_PUBLIC_* variables into the JS bundle at bundle/build time.
Local overrides (recommended)
To keep repo-local settings out of Git, use a local env file:
cd apps/ui
cp .env.local.example .env.localThen edit apps/ui/.env.local and restart the dev server (Metro) so the bundle is rebuilt with the new values.
Disabling features at build time
You can disable specific UI features at build time by setting:
EXPO_PUBLIC_HAPPIER_BUILD_FEATURES_DENY
Example:
EXPO_PUBLIC_HAPPIER_BUILD_FEATURES_DENY=voice,social.friendsThis is a comma-separated list of feature ids (for example voice, social.friends, bugReports, connectedServices, connectedServices.quotas).
Connected services build gates
Connected services also has explicit build-time gates:
EXPO_PUBLIC_HAPPIER_FEATURE_CONNECTED_SERVICES__ENABLED(default:true)EXPO_PUBLIC_HAPPIER_FEATURE_CONNECTED_SERVICES_QUOTAS__ENABLED(default:false)
Examples:
# Completely disable Connected Services in the UI bundle
EXPO_PUBLIC_HAPPIER_FEATURE_CONNECTED_SERVICES__ENABLED=0# Enable Connected Services quota UI surfaces
EXPO_PUBLIC_HAPPIER_FEATURE_CONNECTED_SERVICES_QUOTAS__ENABLED=1Socket transport override (rare)
By default, the app uses Socket.IO / Engine.IO defaults (HTTP long-polling, then upgrade to WebSocket when possible). This is the most compatible option for corporate proxies and restrictive networks.
If you need to force WebSocket-only (for example: you run a multi-server deployment without sticky sessions and you prefer failing fast over long-polling), set:
EXPO_PUBLIC_HAPPIER_SOCKET_FORCE_WEBSOCKET=1
Security note (important)
Only EXPO_PUBLIC_* variables are inlined into the app bundle. Treat all EXPO_PUBLIC_* values as public (never store secrets here).
EAS builds (cloud)
EAS build workers do not use your local .env.local. For cloud builds, set these variables in one of:
apps/ui/eas.jsonunderbuild.<profile>.env, or- the Expo project’s EAS environment variables UI (and ensure the build profile sets the matching
"environment").
If you’re using hstack stacks and you’ve set non-public Expo config env vars (for example EXPO_APP_*, EXPO_EAS_PROJECT_ID, EXPO_UPDATES_URL) in a stack env file, you can sync them into EAS with:
hstack stack eas <stack> env:sync --environment productionSee: /docs/hstack/mobile-ios (EAS builds per stack).