-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(flags): Add browser JS integration docs for Launchdarkly #11839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,54 @@ | ||||||||||||||
--- | ||||||||||||||
title: LaunchDarkly | ||||||||||||||
description: "Attaches recent LaunchDarkly feature flag evaluations to error event context." | ||||||||||||||
notSupported: | ||||||||||||||
- javascript.aws-lambda | ||||||||||||||
- javascript.azure-functions | ||||||||||||||
- javascript.bun | ||||||||||||||
- javascript.capacitor | ||||||||||||||
- javascript.cloudflare | ||||||||||||||
- javascript.connect | ||||||||||||||
- javascript.cordova | ||||||||||||||
- javascript.deno | ||||||||||||||
- javascript.electron | ||||||||||||||
- javascript.express | ||||||||||||||
- javascript.fastify | ||||||||||||||
- javascript.gcp-functions | ||||||||||||||
- javascript.hapi | ||||||||||||||
- javascript.koa | ||||||||||||||
- javascript.nestjs | ||||||||||||||
- javascript.nodejs | ||||||||||||||
- javascript.wasm | ||||||||||||||
--- | ||||||||||||||
|
||||||||||||||
<Alert level="info"> | ||||||||||||||
|
||||||||||||||
This integration only works inside a browser environment. | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we re-frame this to just call out JavaScript and Python as supported SDKs? |
||||||||||||||
|
||||||||||||||
</Alert> | ||||||||||||||
|
||||||||||||||
_Import name: `Sentry.launchDarklyIntegration` and `Sentry.buildLaunchDarklyFlagUsedHandler`_ | ||||||||||||||
|
||||||||||||||
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.** | ||||||||||||||
Comment on lines
+31
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
||||||||||||||
```JavaScript | ||||||||||||||
import * as Sentry from '@sentry/browser'; | ||||||||||||||
import * as LaunchDarkly from 'launchdarkly-js-client-sdk'; | ||||||||||||||
|
||||||||||||||
Sentry.init({integrations: [Sentry.launchDarklyIntegration()]}); | ||||||||||||||
|
||||||||||||||
const ldClient = LaunchDarkly.initialize( | ||||||||||||||
'my-client-ID', | ||||||||||||||
{kind: 'user', key: 'my-user-context-key'}, | ||||||||||||||
{inspectors: [Sentry.buildLaunchDarklyFlagUsedHandler()]} | ||||||||||||||
); | ||||||||||||||
const flagVal = ldClient.variation('my-flag', false); // evaluates a flag | ||||||||||||||
``` | ||||||||||||||
|
||||||||||||||
Learn more about the LaunchDarkly SDK at https://docs.launchdarkly.com/sdk/client-side/javascript. | ||||||||||||||
At the moment, **we do not officially support framework-specific LaunchDarkly | ||||||||||||||
SDKs.** However, you may reuse this setup code for React and client-side Node.js. | ||||||||||||||
Comment on lines
+48
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
||||||||||||||
## Options | ||||||||||||||
|
||||||||||||||
There are no setup options for this integration. | ||||||||||||||
Comment on lines
+52
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Same comment as for open feature - maybe it's best to delete this section? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left it in so we'd remember to update it if we add options in the future. Don't have strong opinions on this though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cmanallen Should this be expanded to feature flag change tracking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this too verbose? "Learn how to attach recent LaunchDarkly feature flag evaluations to your error event context"
@jas-kas The SDK integration doesn't track FF changes, only evaluations leading up to the error. Changes are tracked through the webhook, maybe we can link the docs for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ basically +1 to Michelle's comment below!