forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
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 `__DEV__` or TestFlight
35 */
36export const IS_INTERNAL = IS_DEV || IS_TESTFLIGHT
37
38/**
39 * The commit hash that the current bundle was made from. The user can
40 * see the commit hash in the app's settings along with the other version info.
41 * Useful for debugging/reporting.
42 */
43export const BUNDLE_IDENTIFIER: string =
44 process.env.EXPO_PUBLIC_BUNDLE_IDENTIFIER || 'dev'
45
46/**
47 * This will always be in the format of YYMMDDHH, so that it always increases
48 * for each build. This should only be used for StatSig reporting and shouldn't
49 * be used to identify a specific bundle.
50 */
51export const BUNDLE_DATE: number =
52 process.env.EXPO_PUBLIC_BUNDLE_DATE === undefined
53 ? 0
54 : Number(process.env.EXPO_PUBLIC_BUNDLE_DATE)
55
56/**
57 * The log level for the app.
58 */
59export const LOG_LEVEL = (process.env.EXPO_PUBLIC_LOG_LEVEL || 'info') as
60 | 'debug'
61 | 'info'
62 | 'warn'
63 | 'error'
64
65/**
66 * Enable debug logs for specific logger instances
67 */
68export const LOG_DEBUG: string = process.env.EXPO_PUBLIC_LOG_DEBUG || ''
69
70/**
71 * The DID of the Bluesky appview to proxy to
72 */
73export const BLUESKY_PROXY_DID: Did =
74 process.env.EXPO_PUBLIC_BLUESKY_PROXY_DID || 'did:web:api.bsky.app'
75
76/**
77 * The DID of the chat service to proxy to
78 */
79export const CHAT_PROXY_DID: Did =
80 process.env.EXPO_PUBLIC_CHAT_PROXY_DID || 'did:web:api.bsky.chat'
81
82/**
83 * Sentry DSN for telemetry
84 */
85export const SENTRY_DSN: string | undefined = process.env.EXPO_PUBLIC_SENTRY_DSN
86
87/**
88 * Bitdrift API key. If undefined, Bitdrift should be disabled.
89 */
90export const BITDRIFT_API_KEY: string | undefined =
91 process.env.EXPO_PUBLIC_BITDRIFT_API_KEY
92
93/**
94 * GCP project ID which is required for native device attestation. On web, this
95 * should be unset and evaluate to 0.
96 */
97export const GCP_PROJECT_ID: number =
98 process.env.EXPO_PUBLIC_GCP_PROJECT_ID === undefined
99 ? 0
100 : Number(process.env.EXPO_PUBLIC_GCP_PROJECT_ID)
101
102/**
103 * URLs for the app config web worker. Can be a
104 * locally running server, see `env.example` for more.
105 */
106export const BAPP_CONFIG_DEV_URL = process.env.BAPP_CONFIG_DEV_URL
107export const BAPP_CONFIG_PROD_URL = `https://ip.bsky.app`
108export const BAPP_CONFIG_URL = IS_DEV
109 ? (BAPP_CONFIG_DEV_URL ?? BAPP_CONFIG_PROD_URL)
110 : BAPP_CONFIG_PROD_URL