Skip to content

ref(flags): update unleashIntegration param #12795

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 4 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ The [Unleash](https://www.getunleash.io/) integration tracks feature flag evalua

_Import names: `Sentry.unleashIntegration`_

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).

<PlatformContent includePath="/configuration/unleash" />

<Alert level="info">

The `unleashClientClass` option has been renamed to `featureFlagClientClass` in v9 of the Sentry SDK. Please update accordingly.

</Alert>

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" />
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.ember.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/ember';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/ember';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.gatsby.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/gatsby';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/gatsby';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/browser';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/browser';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.nextjs.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/nextjs';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/nextjs';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.nuxt.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/nuxt';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/nuxt';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.react.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/react';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/react';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.remix.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/remix';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/remix';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.solid.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/solid';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/solid';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.solidstart.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/solidstart';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/solidstart';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.svelte.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/svelte';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/svelte';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.sveltekit.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/sveltekit';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/sveltekit';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down
25 changes: 23 additions & 2 deletions platform-includes/configuration/unleash/javascript.vue.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
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 {tabTitle: JavaScript}
import * as Sentry from '@sentry/vue';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.unleashIntegration({featureFlagClientClass: 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!'));
```

```javascript
```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/vue';
import { UnleashClient } from 'unleash-proxy-client';

Expand Down