-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(flags): document custom featureFlagsIntegration and refactor all…
… JS integration docs (#12151) * feat(flags): document featureFlagsIntegration for custom flag tracking * Lowercase filename and create python file * Del python doc * review comment Co-authored-by: Billy Vong <[email protected]> * keep title consistent w identifier * Rename featureFlags.mdx to featureflags.mdx * Keep sentry/browser in code snippet * Link from js index * Link index from integration doc * Fix invalid Exception syntax * ref(flags): add platform-specific content and refactor JS integration docs (#12172) * ref(flags): add platform-specific content to JS integration docs * featureflags platforms * ld and of platforms * Rm 'Install with npm or yarn' * Label featureflags code as TypeScript * Update info alert and ffs link * Lowercase all code snippet language headers * Rewording from review * Use single quotes in all code snippets * Update provider pkg and docs links * Update links, name 'Generic Support' --------- Co-authored-by: Billy Vong <[email protected]>
- Loading branch information
Showing
47 changed files
with
1,092 additions
and
84 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
docs/platforms/javascript/common/configuration/integrations/featureflags.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
title: FeatureFlags | ||
description: "Learn how to attach custom feature flag data to Sentry error events." | ||
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 | ||
--- | ||
|
||
<PlatformContent includePath="feature-flags/prerelease-alert" /> | ||
|
||
<Alert level="info"> | ||
|
||
This integration only works inside a browser environment. It is only available from a package-based install (e.g. `npm` or `yarn`). | ||
|
||
</Alert> | ||
|
||
<Alert level ="info"> | ||
|
||
If you are using an external feature flag provider, refer to the [supported list](/platforms/javascript/feature-flags/#enable-evaluation-tracking) before setting up this integration. | ||
|
||
</Alert> | ||
|
||
The Feature Flags integration allows you to manually track feature flag evaluations through an API. | ||
These evaluations are held in memory and sent to Sentry when an error occurs. | ||
**At the moment, we only support boolean flag evaluations.** | ||
|
||
_Import names: `Sentry.featureFlagsIntegration` and `type Sentry.FeatureFlagsIntegration`_ | ||
|
||
<PlatformContent includePath="/configuration/featureflags" /> | ||
|
||
Visit the Sentry website and confirm that your error event has recorded the feature flag "test-flag" and its value "false". | ||
|
||
<PlatformContent includePath="feature-flags/next-steps" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.angular.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/angular'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.astro.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/astro'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.ember.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/ember'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.gatsby.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/gatsby'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/browser'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.nextjs.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/nextjs'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.nuxt.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/nuxt'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.react.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/react'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.remix.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/remix'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.solid.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/solid'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.solidstart.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/solidstart'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
17 changes: 17 additions & 0 deletions
17
platform-includes/configuration/featureflags/javascript.svelte.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```typescript | ||
import * as Sentry from '@sentry/svelte'; | ||
|
||
Sentry.init({ | ||
dsn: '___PUBLIC_DSN___', | ||
integrations: [Sentry.featureFlagsIntegration()] | ||
}); | ||
|
||
const flagsIntegration = Sentry.getClient()? | ||
.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags'); | ||
if (flagsIntegration) { | ||
flagsIntegration.addFeatureFlag('test-flag', false); | ||
} else { | ||
// Something went wrong, check your DSN and/or integrations | ||
} | ||
Sentry.captureException(new Error('Something went wrong!')); | ||
``` |
Oops, something went wrong.