MCPcopy Create free account
hub / github.com/Noumena-Network/code / getGrowthBookClientKey

Function getGrowthBookClientKey

src/constants/keys.ts:18–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16// Lazy read so ENABLE_GROWTHBOOK_DEV from globalSettings.env (applied after
17// module load) is picked up. USER_TYPE is a build-time define so it's safe.
18export function getGrowthBookClientKey(): string | undefined {
19 const override = getTrimmedEnv('NOUMENA_GROWTHBOOK_CLIENT_KEY')
20 if (override) {
21 return override
22 }
23
24 if (!isInternalBuild()) {
25 // Public builds must configure a client key explicitly. There is no
26 // hardcoded public default to avoid shipping shared SDK keys in source.
27 return undefined
28 }
29
30 if (isEnvTruthy(process.env.ENABLE_GROWTHBOOK_DEV)) {
31 return ANT_GROWTHBOOK_DEV_CLIENT_KEY
32 }
33
34 return NOUMENA_GROWTHBOOK_CLIENT_KEY_DEFAULT
35}

Callers 3

growthbook.tsFile · 0.85
keys.test.tsFile · 0.85

Calls 3

isEnvTruthyFunction · 0.90
getTrimmedEnvFunction · 0.85
isInternalBuildFunction · 0.85

Tested by

no test coverage detected