Skip to content

Commit b50ef20

Browse files
committed
capture evalFeature method
1 parent ff684eb commit b50ef20

File tree

1 file changed

+4
-0
lines changed
  • packages/browser/src/integrations/featureFlags/growthbook

1 file changed

+4
-0
lines changed

packages/browser/src/integrations/featureFlags/growthbook/integration.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export const growthbookIntegration = defineIntegration(({ growthbookClass }: { g
3737
const proto = growthbookClass.prototype as GrowthBook;
3838
fill(proto, 'isOn', _wrapBooleanReturningMethod);
3939
fill(proto, 'getFeatureValue', _wrapBooleanReturningMethod);
40+
// Also capture evalFeature when present. Not all versions have it, so guard.
41+
if (typeof (proto as unknown as Record<string, unknown>).evalFeature === 'function') {
42+
fill(proto as any, 'evalFeature', _wrapBooleanReturningMethod as any);
43+
}
4044
},
4145

4246
processEvent(event: Event, _hint: EventHint, _client: Client): Event {

0 commit comments

Comments
 (0)