Skip to content

Commit

Permalink
ref(flags): update unleashIntegration param (#12795)
Browse files Browse the repository at this point in the history
* ref(flags): update unleashIntegration param

* Use info alert

* reword

* Update alert, apply for all platforms, and refactor dup code
  • Loading branch information
aliu39 authored Feb 26, 2025
1 parent 0c9278e commit ab63711
Show file tree
Hide file tree
Showing 13 changed files with 284 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,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

0 comments on commit ab63711

Please sign in to comment.