.env file that is git-ignored to prevent accidental exposure.
Initial setup
Fill in your credentials
Open
.env in your editor and replace all placeholder values with your actual API keys. See the sections below for where to obtain each credential.Environment variables reference
Stripe configuration
Stripe publishable key for payment processing. Use test mode keys (
pk_test_...) during development and live keys (pk_live_...) in production.Where to get it: Stripe Dashboard → API KeysFormat: pk_test_51ABC... or pk_live_51ABC...The app will function without this key, but payment features will be limited to mock processing.
Mapbox configuration
Mapbox public token used for runtime map rendering and the Directions API. This token is exposed in the compiled app bundle.Where to get it: Mapbox Account → Access TokensFormat:
pk.eyJ1IjoiY...Scopes required:- Default public token (all public scopes included)
Mapbox secret token used exclusively at build time to download the native Maps SDK. This token is never bundled with the app.Where to get it: Mapbox Account → Access Tokens → Create a secret tokenFormat:
sk.eyJ1IjoiY...Scopes required:DOWNLOADS:READ
This token is automatically read by the
@rnmapbox/maps plugin during prebuild. No additional plugin configuration is needed.Telegram bot configuration
Telegram bot token used to send PDF receipts to a specified chat. Obtain this from BotFather.Where to get it: Message @BotFather on Telegram and use the
/newbot commandFormat: 123456:ABC-DEF1234ghIkl...If omitted, the app will skip Telegram dispatch but continue functioning normally.
The target chat ID where PDF receipts will be sent. This can be your personal chat ID or a group/channel ID.Where to get it: Message @userinfobot or @RawDataBot to retrieve your personal chat IDFormat: Numeric string (e.g.,
123456789)Both
EXPO_PUBLIC_TELEGRAM_BOT_TOKEN and EXPO_PUBLIC_TELEGRAM_CHAT_ID must be configured for Telegram features to work.Example configuration
Here’s a complete.env file with all variables populated:
Configuration validation
The app reads all environment variables through the centralizedConfig object in src/lib/core/config.ts:
src/lib/core/config.ts
Security best practices
Follow these guidelines to keep your credentials secure:
- Never commit
.envto version control - Use test/development keys during local development
- Rotate keys immediately if accidentally exposed
- Use separate Stripe accounts for test and production
- Restrict Mapbox token scopes to only what’s needed
- Keep secret tokens (starting with
sk.) out of client bundles
Troubleshooting
Maps not rendering
Cause: Missing or invalidEXPO_PUBLIC_MAPBOX_TOKEN
Solution: Verify the token is copied correctly and has not expired. Check the Mapbox dashboard for token status.
Build fails with Mapbox SDK download error
Cause: Missing or invalidRNMAPBOX_MAPS_DOWNLOAD_TOKEN or missing DOWNLOADS:READ scope
Solution: Create a new secret token with the correct scope in your Mapbox account settings.
Telegram receipts not sending
Cause: Missing or misconfiguredEXPO_PUBLIC_TELEGRAM_BOT_TOKEN or EXPO_PUBLIC_TELEGRAM_CHAT_ID
Solution: Verify both values are set and that the bot has permission to send messages to the specified chat. For groups/channels, ensure the bot has been added as a member.
Next steps
Mapbox setup
Configure map rendering and delivery routes
Stripe setup
Set up payment processing
Telegram bot
Enable receipt dispatch via Telegram