You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/configuration/integrations/launchdarkly.mdx
+26-4Lines changed: 26 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,15 @@ This integration only works inside a browser environment.
29
29
30
30
</Alert>
31
31
32
-
The [LaunchDarkly](https://launchdarkly.com/) integration tracks feature flag evaluations produced by the LaunchDarkly SDK. These evaluations are held in memory and sent to Sentry for review and analysis if an error occurs. **At the moment, we only support boolean flag evaluations.**
32
+
The [LaunchDarkly](https://launchdarkly.com/) integration tracks feature flag evaluations produced by the LaunchDarkly SDK. These evaluations are held in memory, and in the event an error occurs, sent to Sentry for review and analysis. **At the moment, we only support boolean flag evaluations.**
33
33
34
-
_Import name: `Sentry.launchDarklyIntegration` and `Sentry.buildLaunchDarklyFlagUsedHandler`_
34
+
_Import names: `Sentry.launchDarklyIntegration` and `Sentry.buildLaunchDarklyFlagUsedHandler`_
35
+
36
+
## Install
37
+
38
+
Install [`@sentry/browser`](https://www.npmjs.com/package/@sentry/browser) and [`launchdarkly-js-client-sdk`](https://www.npmjs.com/package/launchdarkly-js-client-sdk) from npm.
constflagVal=ldClient.variation('my-flag', false); // evaluates a flag
51
56
```
52
57
53
-
Learn more about the [LaunchDarkly SDK](https://docs.launchdarkly.com/sdk/client-side/javascript). At the moment, **we aren't officially supporting framework-specific LaunchDarkly SDKs.** However, you can reuse this setup code for React and client-side Node.js.
58
+
Learn more about the [LaunchDarkly SDK](https://docs.launchdarkly.com/sdk/client-side/javascript). At the moment, **we aren't officially supporting framework-specific LaunchDarkly SDKs.** However, you may reuse the setup code for [React](https://www.npmjs.com/package/launchdarkly-react-client-sdk) and [client-side Node.js](https://www.npmjs.com/package/launchdarkly-node-client-sdk).
59
+
60
+
## Verify
61
+
62
+
The integration is tested by evaluating a feature flag with your LaunchDarkly SDK before capturing an exception.
// Evaluate a flag with a default value, with the ldClient from the Configure step.
69
+
// You may have to wait for your client to initialize before doing this.
70
+
ldClient?.variation("hello", false);
71
+
72
+
Sentry.captureException(Exception("Something went wrong!"))
73
+
```
74
+
75
+
Visit the Sentry website and confirm that your error event has recorded the feature flag "hello" and its value "false". For a full end-to-end test, you must create the flag and a targeting rule in LaunchDarkly. Learn more about the LaunchDarkly SDK [here](https://docs.launchdarkly.com/sdk/client-side/javascript).
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/configuration/integrations/openfeature.mdx
+31-4Lines changed: 31 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,15 @@ This integration only works inside a browser environment.
29
29
30
30
</Alert>
31
31
32
+
The [OpenFeature](https://openfeature.dev/) integration tracks feature flag evaluations produced by the OpenFeature SDK. These evaluations are held in memory, and in the event an error occurs, sent to Sentry for review and analysis. **At the moment, we only support boolean flag evaluations.**
33
+
32
34
_Import name: `Sentry.openFeatureIntegration` and `Sentry.OpenFeatureIntegrationHook`_
33
35
34
-
The [OpenFeature](https://openfeature.dev/) integration tracks feature flag evaluations produced by the OpenFeature SDK. These evaluations are held in memory and sent to Sentry for review and analysis if an error occurs. **At the moment, we only support boolean flag evaluations.**
36
+
## Install
37
+
38
+
Install [`@sentry/browser`](https://www.npmjs.com/package/@sentry/browser) and [`@openfeature/web-sdk`](https://www.npmjs.com/package/@openfeature/web-sdk) from npm.
Sentry.captureException(Exception("Something went wrong!"))
50
77
```
51
78
52
-
Learn more about the [OpenFeature SDK](https://github.com/open-feature/js-sdk/tree/main).
79
+
Visit the Sentry website and confirm that your error event has recorded the feature flag "hello" and its value "false". Learn more about the OpenFeature SDK at https://github.com/open-feature/js-sdk/tree/main.
0 commit comments