Clean up env

This commit is contained in:
Eric Bailey
2025-02-12 16:43:00 -06:00
parent 1a3ecdf6ec
commit 4349c7f16d
2 changed files with 73 additions and 7 deletions
+21 -6
View File
@@ -1,8 +1,23 @@
# Copy this to `.env` and `.env.test` files
BITDRIFT_API_KEY=
SENTRY_AUTH_TOKEN=
EXPO_PUBLIC_LOG_LEVEL=debug
EXPO_PUBLIC_LOG_DEBUG=
# The env the app is running in e.g. development, testflight, production
EXPO_PUBLIC_ENV=development
# This is the commit hash that the current bundle was made from. The user can
# see the commit hash in the app's settings along with the other version info.
# Useful for debugging/reporting.
EXPO_PUBLIC_BUNDLE_IDENTIFIER=
# This will always be in the format of YYMMDD, so that it always increases for
# each build. This should only be used for Statsig reporting and shouldn't be
# used to identify a specific bundle.
EXPO_PUBLIC_BUNDLE_DATE=0
# The log level for the app's logger transports
EXPO_PUBLIC_LOG_LEVEL=info
# Currently unused. Enable debug for a subset of the debug logs.
EXPO_PUBLIC_LOG_DEBUG=
#
# Bluesky specific
#
# Bitdrift
BITDRIFT_API_KEY=
# Sentry
SENTRY_AUTH_TOKEN=
+52 -1
View File
@@ -1,6 +1,57 @@
export const LOG_DEBUG = process.env.EXPO_PUBLIC_LOG_DEBUG || ''
/**
* The env the app is running in e.g. development, testflight, production
*/
export const EXPO_PUBLIC_ENV = process.env.EXPO_PUBLIC_ENV
/**
* Indicates whether the app is running in TestFlight mode
*/
export const IS_TESTFLIGHT = EXPO_PUBLIC_ENV === 'testflight'
/**
* Indicates whether the app is __DEV__ or TestFlight
*/
export const IS_INTERNAL = __DEV__ || IS_TESTFLIGHT
/**
* The commit hash that the current bundle was made from. The user can see the
* commit hash in the app's settings along with the other version info. Useful
* for debugging/reporting.
*/
export const BUNDLE_IDENTIFIER: string =
process.env.EXPO_PUBLIC_BUNDLE_IDENTIFIER ?? ''
/**
* This will always be in the format of YYMMDD, so that it always increases for
* each build. This should only be used for Statsig reporting and shouldn't be
* used to identify a specific bundle.
*/
export const BUNDLE_DATE: number = IS_INTERNAL
? 0
: Number(process.env.EXPO_PUBLIC_BUNDLE_DATE)
/**
* The log level for the app.
*/
export const LOG_LEVEL = (process.env.EXPO_PUBLIC_LOG_LEVEL || 'info') as
| 'debug'
| 'info'
| 'warn'
| 'error'
/**
* Currently unused. Enable debug for a subset of the debug logs.
*/
export const LOG_DEBUG: string = process.env.EXPO_PUBLIC_LOG_DEBUG || ''
/**
* Bitdrift API key. If undefined, Bitdrift should be disabled.
*/
export const BITDRIFT_API_KEY: string | undefined =
process.env.EXPO_PUBLIC_BITDRIFT_API_KEY
/**
* Sentry API key. If undefined, Sentry should be disabled.
*/
export const SENTRY_API_KEY: string | undefined =
process.env.EXPO_PUBLIC_SENTRY_API_KEY