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

Function createClient

src/services/analytics/growthbook.ts:615–635  ·  view source on GitHub ↗
(selectedClientKey: string)

Source from the content-addressed store, hash-verified

613 clientCreatedWithAuth = hasAuth
614
615 const createClient = (selectedClientKey: string): GrowthBook =>
616 new GrowthBook({
617 apiHost: baseUrl,
618 clientKey: selectedClientKey,
619 attributes,
620 // Add auth headers if available
621 ...(authHeaders.error
622 ? {}
623 : { apiHostRequestHeaders: authHeaders.headers }),
624 onFeatureUsage: (feature, result) => {
625 updateExperimentDataForFeature(feature, result)
626 },
627 // Debug logging for Ants
628 ...(isInternalBuild()
629 ? {
630 log: (msg: string, ctx: Record<string, unknown>) => {
631 logForDebugging(`GrowthBook: ${msg} ${jsonStringify(ctx)}`)
632 },
633 }
634 : {}),
635 })
636
637 const finalizeInit = async (
638 growthBookClient: GrowthBook,

Callers 2

finalizeInitFunction · 0.85
growthbook.tsFile · 0.85

Calls 4

isInternalBuildFunction · 0.85
jsonStringifyFunction · 0.85
logForDebuggingFunction · 0.50

Tested by

no test coverage detected