Skip to content

Commit dc5b2e5

Browse files
committed
Add OpenFeature integration docs
1 parent 9add7e0 commit dc5b2e5

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: OpenFeature
3+
description: "Attaches recent OpenFeature feature flag evaluations to error event context."
4+
notSupported:
5+
- javascript.aws-lambda
6+
- javascript.azure-functions
7+
- javascript.bun
8+
- javascript.capacitor
9+
- javascript.cloudflare
10+
- javascript.connect
11+
- javascript.cordova
12+
- javascript.deno
13+
- javascript.electron
14+
- javascript.express
15+
- javascript.fastify
16+
- javascript.gcp-functions
17+
- javascript.hapi
18+
- javascript.koa
19+
- javascript.nestjs
20+
- javascript.nodejs
21+
- javascript.wasm
22+
---
23+
24+
<Alert level="info">
25+
26+
This integration only works inside a browser environment.
27+
28+
</Alert>
29+
30+
_Import name: `Sentry.openFeatureIntegration` and `Sentry.OpenFeatureIntegrationHook`_
31+
32+
The [OpenFeature](https://https://openfeature.dev/) integration tracks feature flag evaluations produced by the OpenFeature 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.**
33+
34+
```JavaScript
35+
import * as Sentry from '@sentry/browser';
36+
import { OpenFeature } from '@openfeature/web-sdk';
37+
38+
Sentry.init({integrations: [Sentry.openFeatureIntegration()]});
39+
40+
const client = OpenFeature.getClient();
41+
client.addHooks(new OpenFeatureIntegrationHook());
42+
43+
// Evaluating flags will record the result on the Sentry client.
44+
const result = client.getBooleanValue('my-flag', false);
45+
```
46+
47+
Learn more about the OpenFeature SDK at https://github.com/open-feature/js-sdk/tree/main.
48+
49+
## Options
50+
51+
There are no setup options for this integration.

0 commit comments

Comments
 (0)