Môi Trường Và Biến Cấu Hình
Cập nhật: 2026-05-24
File Local
.envlà file local, không commit..env.examplelà template cho dev.FIGMA_TOKENchỉ dùng cho script/QA local, không expose vào app runtime.
Biến Runtime Cho Expo
Các biến public phải có prefix EXPO_PUBLIC_:
EXPO_PUBLIC_APP_ENV:development,staging, hoặcproduction.EXPO_PUBLIC_API_URL: base URL backend, mặc định hiện làhttps://web-golden.azns.vn.EXPO_PUBLIC_LOTUS_SHOP_API_URL: Vendure Shop API URL, mặc định hiện làhttps://web-golden.azns.vn/shop-api.EXPO_PUBLIC_LOTUS_CHANNEL_TOKEN: Vendure channel token gửi qua headervendure-tokennếu channel cần token.EXPO_PUBLIC_EAS_PROJECT_ID: Expo project id cho Expo push token.EXPO_PUBLIC_GOOGLE_MAPS_STATIC_KEY: Google Maps static image key.EXPO_PUBLIC_GOLDEN_LOTUS_FACEBOOK_URL: community URL dùng trong app.EXPO_PUBLIC_LOCATION_PROMPT_ENABLED: bật/tắt prompt xin quyền vị trí.EXPO_PUBLIC_USE_MOCK:truekhi dùng mock data,falsekhi gọi API thật.EXPO_PUBLIC_USE_LOTUS_AUTH_API: bật/tắt auth API thật.EXPO_PUBLIC_USE_LOTUS_BOOKING_API: bật/tắt booking/service API thật.EXPO_PUBLIC_PUSH_TOKEN_PROVIDER:expohoặcfirebase. Khi đặtfirebase, Android lấy native device push token; các nền tảng khác vẫn fallback Expo token.
Default trong code nằm ở core/config/env.ts:
EXPO_PUBLIC_APP_ENVthiếu thì dùngdevelopment.EXPO_PUBLIC_API_URLthiếu thì dùnghttps://web-golden.azns.vn.EXPO_PUBLIC_LOTUS_SHOP_API_URLthiếu thì dùnghttps://web-golden.azns.vn/shop-api.EXPO_PUBLIC_USE_MOCKthiếu thì dùngtrue.EXPO_PUBLIC_USE_LOTUS_AUTH_APIthiếu thì dùngtrue.EXPO_PUBLIC_USE_LOTUS_BOOKING_APIthiếu thì dùngtrue.EXPO_PUBLIC_PUSH_TOKEN_PROVIDERthiếu thì dùngexpo.
Gợi Ý Theo Môi Trường
Development:
EXPO_PUBLIC_APP_ENV=developmentEXPO_PUBLIC_USE_MOCK=true
Staging:
EXPO_PUBLIC_APP_ENV=stagingEXPO_PUBLIC_API_URL=https://web-golden.azns.vnEXPO_PUBLIC_LOTUS_SHOP_API_URL=https://web-golden.azns.vn/shop-apiEXPO_PUBLIC_USE_MOCK=falseEXPO_PUBLIC_USE_LOTUS_AUTH_API=trueEXPO_PUBLIC_USE_LOTUS_BOOKING_API=true
Production:
EXPO_PUBLIC_APP_ENV=productionEXPO_PUBLIC_API_URL=https://web-golden.azns.vnEXPO_PUBLIC_LOTUS_SHOP_API_URL=https://web-golden.azns.vn/shop-apiEXPO_PUBLIC_USE_MOCK=falseEXPO_PUBLIC_USE_LOTUS_AUTH_API=trueEXPO_PUBLIC_USE_LOTUS_BOOKING_API=true
Push Token Provider
Hiện app hỗ trợ 2 đường token:
expo: gọiNotifications.getExpoPushTokenAsync(). Phù hợp Expo/dev-client và giữ tương thích token cũ.firebase: trên Android gọiNotifications.getDevicePushTokenAsync()để lấy native FCM token cho Firebase Admin; iOS/web vẫn dùng Expo token cho tới khi có native APNs/Firebase flow riêng.
Backend hiện có unified push service: token Expo đi qua Expo provider, token còn lại đi Firebase provider.
Lệnh QA
npm run test:smoke: kiểm tra i18n key parity, route re-export, feature module tối thiểu và package id.npx tsc --noEmit: kiểm tra TypeScript.npm run lint: kiểm tra lint.