MCPcopy Index your code
hub / github.com/codeaashu/claude-code / logExposureForFeature

Function logExposureForFeature

src/services/analytics/growthbook.ts:296–314  ·  view source on GitHub ↗

* Log experiment exposure for a feature if it has experiment data. * Deduplicates within a session - each feature is logged at most once.

(feature: string)

Source from the content-addressed store, hash-verified

294 * Deduplicates within a session - each feature is logged at most once.
295 */
296function logExposureForFeature(feature: string): void {
297 // Skip if already logged this session (dedup)
298 if (loggedExposures.has(feature)) {
299 return
300 }
301
302 const expData = experimentDataByFeature.get(feature)
303 if (expData) {
304 loggedExposures.add(feature)
305 logGrowthBookExperimentTo1P({
306 experimentId: expData.experimentId,
307 variationId: expData.variationId,
308 userAttributes: getUserAttributes(),
309 experimentMetadata: {
310 feature_id: feature,
311 },
312 })
313 }
314}
315
316/**
317 * Process a remote eval payload from the GrowthBook server and populate

Calls 5

getUserAttributesFunction · 0.85
getMethod · 0.65
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected