-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(flags): document JS Unleash integration #12338
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
080b765
init
aliu39 80bd50c
Add platform content
aliu39 b50479e
Add to integration table
aliu39 d85a80a
Single quote (thanks cursor)
aliu39 27ca5aa
Update setup code integration params
aliu39 117b372
Fill in min version
aliu39 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
docs/platforms/javascript/common/configuration/integrations/unleash.mdx
This file contains hidden or 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,40 @@ | ||
--- | ||
title: Unleash | ||
description: "Learn how to use Sentry with Unleash." | ||
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> | ||
|
||
The [Unleash](https://www.getunleash.io/) integration tracks feature flag evaluations produced by the Unleash 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.** This integration is available in Sentry SDK **versions 8.TODO: or higher.** | ||
|
||
_Import names: `Sentry.unleashIntegration`_ | ||
|
||
<PlatformContent includePath="/configuration/unleash" /> | ||
|
||
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" /> |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.ember.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/ember"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
aliu39 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.gatsby.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/gatsby"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/browser"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.nextjs.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/nextjs"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.nuxt.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/nuxt"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.react.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/react"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.remix.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/remix"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.solid.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/solid"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.solidstart.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/solidstart"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.svelte.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/svelte"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.sveltekit.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/sveltekit"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
24 changes: 24 additions & 0 deletions
24
platform-includes/configuration/unleash/javascript.vue.mdx
This file contains hidden or 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,24 @@ | ||
Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading [Unleash's SDK reference](https://docs.getunleash.io/reference/sdks/javascript-browser) and [quickstart](https://docs.getunleash.io/quickstart). | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/vue"; | ||
import { UnleashClient } from "unleash-proxy-client"; | ||
|
||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [Sentry.unleashIntegration(UnleashClient)], | ||
}); | ||
|
||
const unleash = new UnleashClient({ | ||
url: "https://<your-unleash-instance>/api/frontend", | ||
clientKey: "<your-client-side-token>", | ||
appName: "my-webapp", | ||
}); | ||
|
||
unleash.start(); | ||
|
||
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first. | ||
unleash.isEnabled("test-flag"); | ||
|
||
Sentry.captureException(new Error("Something went wrong!")); | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.