FleetbaseFleetbase

Configuration

Every environment setting the Storefront App reads — keys, payments, sign-in, region, maps, realtime and release values — and where branding lives instead.

Configuration

The app is configured in two places:

  • .env holds keys, hosts and switches: what differs between environments and builds. It is compiled into the native apps at build time, so a change needs a rebuild.
  • The brand file, brand/storefront.brand.ts, holds how the app looks and what it opens on: colors, fonts, components, tabs and home screen. See Branding and Home Screens & Tabs.

Keep .env out of git. In a release pipeline, write it from your secrets before the build.

Required

KeyWhat it is
STOREFRONT_KEYThe store key (store_…) or network key (network_…), from Storefront → Settings → API
FLEETBASE_KEYA Fleetbase API key, from Developers → API Keys
FLEETBASE_HOSTYour Fleetbase API: https://api.fleetbase.io on Fleetbase Cloud, or your own server
GOOGLE_MAPS_API_KEYGoogle Maps on Android, and address search
APP_NAMEThe app's name under its icon
APP_IDENTIFIERThe Android application id (the iOS bundle id is set in Xcode; see Build & Release)

Payments

KeyDefaultWhat it does
PAYMENT_GATEWAYstripestripe or qpay
STRIPE_KEY—Stripe publishable key
STRIPE_PAYMENT_UIsheetsheet (Stripe's payment sheet) or field (a card field in the checkout)
STRIPE_ENABLE_APPLE_PAY, STRIPE_ENABLE_GOOGLE_PAYfalseWallet buttons in the payment sheet
TIP_INCREMENT50Tip step, in the currency's smallest unit
PRIORITIZE_PICKUPfalseStart checkout on pickup instead of delivery

The gateway's credentials are set in the Console. See Payments & Integrations.

Sign-in

KeyDefaultWhat it does
APPLE_LOGIN_ENABLEDfalseSign in with Apple (iOS)
GOOGLE_LOGIN_ENABLEDfalseSign in with Google (iOS and Android)
GOOGLE_CLIENT_ID—The web OAuth client id, without .apps.googleusercontent.com
GOOGLE_IOS_CLIENT_ID—The iOS OAuth client id, without .apps.googleusercontent.com

Phone number and texted code is always available. See Sign-in.

Language and region

KeyDefaultWhat it does
DEFAULT_LOCALEenThe language the app starts in. A customer's own choice is remembered on their device
AVAILABLE_LOCALESen,mn,ukThe languages offered in the language switcher
DEFAULT_COUNTRYdevice regionThe country the phone field starts on, as an ISO code, e.g. MN for +976
DEFAULT_COORDINATES—lat,lng used until the customer's location is known

Maps and addresses

KeyDefaultWhat it does
DEFAULT_MAP_TYPEstandardstandard, satellite, hybrid or terrain, on every map in the app
DISABLE_GEOCODING_SCREENfalseAdd addresses with the map pin only. The address screen always offers Choose on the map; this skips address search altogether, for regions where it is weak

Realtime

Live order status, driver positions and chat come over SocketCluster. On Fleetbase Cloud the defaults are right; set these when self-hosting.

KeyDefaultWhat it does
SOCKETCLUSTER_HOSTsocket.fleetbase.ioYour socket server
SOCKETCLUSTER_PORT8000Its port
SOCKETCLUSTER_SECUREtruewss (true) or ws (false)
SOCKETCLUSTER_PATH/socketcluster/Its path
KeyWhat it does
TOS_URL, PRIVACY_URLTerms and privacy policy, linked from the account screen and sign-in
APP_LINK_PREFIXThe URL scheme for deep links, e.g. myshop for myshop://

Release values

KeyWhat it does
ANDROID_VERSION_CODEAndroid versionCode; must go up for every Google Play upload
ANDROID_VERSION_NAMEAndroid versionName, e.g. 1.3.0
ANDROID_STOREFRONT_APP_UPLOAD_STORE_FILE, …_STORE_PASSWORD, …_KEY_ALIAS, …_KEY_PASSWORDThe Android upload keystore. Without them a release build is signed with the debug key (fine for testing, not for Google Play)

These can also be environment variables in CI rather than .env entries. See Build & Release.

Switching stores in development

In a debug build, values in a git-ignored env.dev.json at the repository root replace the .env values, so you can point the app at another store or Network without rebuilding:

{ "STOREFRONT_KEY": "network_…", "FLEETBASE_KEY": "flb_…" }

Restart Metro after creating or deleting the file; edits to it apply on reload. Release builds ignore it, and native-only values (such as the Google Maps key on Android) still come from the build.

Older branding keys

Earlier versions set the look through .env. These keys still work, and the brand file overrides them, so existing builds keep their look until they move to a brand file:

KeyBrand file equivalent
APP_THEME, CUSTOM_COLORS, CUSTOM_COLORS_LIGHT, CUSTOM_COLORS_DARKcolors
STORE_HEADER_*components.storeHeader
PRODUCT_CARD_STYLE, STORE_CATEGORIES_DISPLAYcomponents.productCard, components.storeCategories
STORE_NAVIGATOR_TABS, STORE_NAVIGATOR_DEFAULT_TAB, STORE_NAVIGATOR_TAB_BAR_BGnavigation.store
HOME_SCREEN, NETWORK_FOOD_TRUCKS_TABnavigation.home, navigation.network.foodTrucks
LOGIN_BG_IMAGE, BOOTSCREEN_BG_IMAGE, BOOTSCREEN_BACKGROUND_COLORassets, boot
STORE_<TAB>_TAB_LABEL_<LOCALE>, STORE_<TAB>_TAB_ICONnavigation.tabs and brand/translations

New builds should use the brand file: it is typed, validated and covers far more. See Branding.

Configuration | Fleetbase