Skip to content

Commit dfdae98

Browse files
committed
remove evalFunction
1 parent 8b2914f commit dfdae98

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

packages/core/src/integrations/featureFlags/growthbook.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ export type GrowthBookClassLike = new (...args: unknown[]) => GrowthBookLike;
2020
* Sentry integration for capturing feature flag evaluations from GrowthBook.
2121
*
2222
* Only boolean results are captured at this time.
23+
*
24+
* @example
25+
* ```typescript
26+
* import { GrowthBook } from '@growthbook/growthbook';
27+
* import * as Sentry from '@sentry/browser'; // or '@sentry/node'
28+
*
29+
* Sentry.init({
30+
* dsn: 'your-dsn',
31+
* integrations: [
32+
* Sentry.growthbookIntegration({ growthbookClass: GrowthBook })
33+
* ]
34+
* });
35+
* ```
2336
*/
2437
export const growthbookIntegration = defineIntegration(
2538
({ growthbookClass }: { growthbookClass: GrowthBookClassLike }) => {
@@ -39,11 +52,6 @@ export const growthbookIntegration = defineIntegration(
3952
fill(proto, 'getFeatureValue', _wrapAndCaptureBooleanResult);
4053
}
4154

42-
// Type guard and wrap evalFeature if present
43-
const maybeEval = (proto as unknown as Record<string, unknown>).evalFeature;
44-
if (typeof maybeEval === 'function') {
45-
fill(proto as unknown as Record<string, unknown>, 'evalFeature', _wrapAndCaptureBooleanResult as any);
46-
}
4755
},
4856

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

0 commit comments

Comments
 (0)