Replace NODE_ENV in places where its safe

This commit is contained in:
Eric Bailey
2025-07-22 18:46:09 -05:00
parent fce7aa07e4
commit 4d4b903ccd
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import {type Did} from '@atproto/api'
/**
* The env the app is running in e.g. development, testflight, production
*/
export const ENV = process.env.EXPO_PUBLIC_ENV
export const ENV: string = process.env.EXPO_PUBLIC_ENV
/**
* Indicates whether the app is running in TestFlight
+2 -1
View File
@@ -9,6 +9,7 @@ import {type MetricEvents} from '#/logger/metrics'
import {isWeb} from '#/platform/detection'
import * as persisted from '#/state/persisted'
import packageDotJson from '../../../package.json'
import {ENV} from '#/env'
import {useSession} from '../../state/session'
import {timeout} from '../async/timeout'
import {useNonReactiveCallback} from '../hooks/useNonReactiveCallback'
@@ -50,7 +51,7 @@ function createStatsigOptions(prefetchUsers: StatsigUser[]) {
return {
environment: {
tier:
process.env.NODE_ENV === 'development'
ENV === 'development'
? 'development'
: IS_TESTFLIGHT
? 'staging'
+2 -1
View File
@@ -14,9 +14,10 @@ import {
} from '#/logger/types'
import {enabledLogLevels} from '#/logger/util'
import {isNative} from '#/platform/detection'
import {ENV} from '#/env'
const TRANSPORTS: Transport[] = (function configureTransports() {
switch (process.env.NODE_ENV) {
switch (ENV) {
case 'production': {
return [sentryTransport, isNative && bitdriftTransport].filter(
Boolean,