Bluesky app fork with some witchin' additions 馃挮
at main 133 lines 3.6 kB view raw
1import {type Did} from '@atproto/api' 2 3import packageJson from '#/../package.json' 4 5/** 6 * The semver version of the app, as defined in `package.json.` 7 * 8 * N.B. The fallback is needed for Render.com deployments 9 */ 10export const RELEASE_VERSION: string = 11 process.env.EXPO_PUBLIC_RELEASE_VERSION || packageJson.version 12 13/** 14 * The env the app is running in e.g. development, testflight, production, e2e 15 */ 16export const ENV: string = process.env.EXPO_PUBLIC_ENV as 17 | 'production' 18 | 'testflight' 19 | 'development' 20 | 'e2e' 21 | (string & {}) 22 23/** 24 * Indicates whether the app is running in TestFlight 25 */ 26export const IS_TESTFLIGHT = ENV === 'testflight' 27 28/** 29 * Indicates whether the app is `__DEV__` 30 */ 31export const IS_DEV = __DEV__ 32 33/** 34 * Indicates whether the app is running in a test environment 35 */ 36export const IS_E2E = ENV === 'e2e' 37 38/** 39 * Indicates whether the app is `__DEV__` or TestFlight 40 */ 41export const IS_INTERNAL = IS_DEV || IS_TESTFLIGHT 42 43/** 44 * The commit hash that the current bundle was made from. The user can 45 * see the commit hash in the app's settings along with the other version info. 46 * Useful for debugging/reporting. 47 */ 48export const BUNDLE_IDENTIFIER: string = 49 process.env.EXPO_PUBLIC_BUNDLE_IDENTIFIER || 'dev' 50 51/** 52 * This will always be in the format of YYMMDDHH, so that it always increases 53 * for each build. This should only be used for analytics reporting and shouldn't 54 * be used to identify a specific bundle. 55 */ 56export const BUNDLE_DATE: number = 57 process.env.EXPO_PUBLIC_BUNDLE_DATE === undefined 58 ? 0 59 : Number(process.env.EXPO_PUBLIC_BUNDLE_DATE) 60 61/** 62 * The log level for the app. 63 */ 64export const LOG_LEVEL = (process.env.EXPO_PUBLIC_LOG_LEVEL || 'info') as 65 | 'debug' 66 | 'info' 67 | 'warn' 68 | 'error' 69 70/** 71 * Enable debug logs for specific logger instances 72 */ 73export const LOG_DEBUG: string = process.env.EXPO_PUBLIC_LOG_DEBUG || '' 74 75/** 76 * The DID of the Bluesky appview to proxy to 77 */ 78export const BLUESKY_PROXY_DID: Did = 79 process.env.EXPO_PUBLIC_BLUESKY_PROXY_DID || 'did:web:api.bsky.app' 80 81/** 82 * The DID of the chat service to proxy to 83 */ 84export const CHAT_PROXY_DID: Did = 85 process.env.EXPO_PUBLIC_CHAT_PROXY_DID || 'did:web:api.bsky.chat' 86 87/** 88 * Metrics API host 89 */ 90export const METRICS_API_HOST: string = 91 process.env.EXPO_PUBLIC_METRICS_API_HOST || 'https://events.bsky.app' 92 93/** 94 * Growthbook API host 95 */ 96export const GROWTHBOOK_API_HOST: string = 97 process.env.EXPO_PUBLIC_GROWTHBOOK_API_HOST || `${METRICS_API_HOST}/gb` 98 99/** 100 * Growthbook client key 101 */ 102export const GROWTHBOOK_CLIENT_KEY: string = 103 process.env.EXPO_PUBLIC_GROWTHBOOK_CLIENT_KEY || 'sdk-7gkUkGy9wguUjyFe' 104 105/** 106 * Sentry DSN for telemetry 107 */ 108export const SENTRY_DSN: string | undefined = process.env.EXPO_PUBLIC_SENTRY_DSN 109 110/** 111 * Bitdrift API key. If undefined, Bitdrift should be disabled. 112 */ 113export const BITDRIFT_API_KEY: string | undefined = 114 process.env.EXPO_PUBLIC_BITDRIFT_API_KEY 115 116/** 117 * GCP project ID which is required for native device attestation. On web, this 118 * should be unset and evaluate to 0. 119 */ 120export const GCP_PROJECT_ID: number = 121 process.env.EXPO_PUBLIC_GCP_PROJECT_ID === undefined 122 ? 0 123 : Number(process.env.EXPO_PUBLIC_GCP_PROJECT_ID) 124 125/** 126 * URLs for the live-event config web worker. Can be a 127 * locally running server, see `env.example` for more. 128 */ 129export const LIVE_EVENTS_DEV_URL = process.env.LIVE_EVENTS_DEV_URL 130export const LIVE_EVENTS_PROD_URL = `https://live-events.workers.bsky.app` 131export const LIVE_EVENTS_URL = IS_DEV 132 ? (LIVE_EVENTS_DEV_URL ?? LIVE_EVENTS_PROD_URL) 133 : LIVE_EVENTS_PROD_URL