Skip to content

Commit ab63711

Browse files
authored
ref(flags): update unleashIntegration param (#12795)
* ref(flags): update unleashIntegration param * Use info alert * reword * Update alert, apply for all platforms, and refactor dup code
1 parent 0c9278e commit ab63711

13 files changed

+284
-24
lines changed

docs/platforms/javascript/common/configuration/integrations/unleash.mdx

+8
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,16 @@ The [Unleash](https://www.getunleash.io/) integration tracks feature flag evalua
3434

3535
_Import names: `Sentry.unleashIntegration`_
3636

37+
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).
38+
3739
<PlatformContent includePath="/configuration/unleash" />
3840

41+
<Alert level="info">
42+
43+
The `unleashClientClass` option has been renamed to `featureFlagClientClass` in v9 of the Sentry SDK. Please update accordingly.
44+
45+
</Alert>
46+
3947
Visit the Sentry website and confirm that your error event has recorded the feature flag "test-flag" and its value "false".
4048

4149
<PlatformContent includePath="feature-flags/next-steps" />

platform-includes/configuration/unleash/javascript.ember.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/ember';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.gatsby.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/gatsby';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/browser';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.nextjs.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/nextjs';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.nuxt.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/nuxt';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.react.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/react';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.remix.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/remix';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.solid.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/solid';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.solidstart.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/solidstart';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.svelte.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/svelte';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.sveltekit.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/sveltekit';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

platform-includes/configuration/unleash/javascript.vue.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
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).
1+
```javascript {tabTitle: JavaScript}
2+
import * as Sentry from '@sentry/vue';
3+
import { UnleashClient } from 'unleash-proxy-client';
4+
5+
Sentry.init({
6+
dsn: '___PUBLIC_DSN___',
7+
integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
8+
});
9+
10+
const unleash = new UnleashClient({
11+
url: 'https://<your-unleash-instance>/api/frontend',
12+
clientKey: '<your-client-side-token>',
13+
appName: 'my-webapp',
14+
});
15+
16+
unleash.start();
17+
18+
// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
19+
unleash.isEnabled('test-flag');
20+
21+
Sentry.captureException(new Error('Something went wrong!'));
22+
```
223

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

0 commit comments

Comments
 (0)