(selectedClientKey: string)
| 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, |
no test coverage detected