Skip to content

Commit 4a6d5e5

Browse files
committed
add docs
1 parent fa988b8 commit 4a6d5e5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/flagging/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
# Flagging SDK
22

33
This package supports flagging and experimentation by performing evaluation in the browser.
4+
5+
## Initialize
6+
7+
```
8+
const datadogFlaggingProvider = createDatadogProvider()
9+
10+
// provide the subject
11+
const subject = {
12+
key: 'subject-key-1',
13+
}
14+
await OpenFeature.setContext(subject)
15+
16+
// initialize
17+
await OpenFeature.setProviderAndWait(datadogFlaggingProvider)
18+
```
19+
20+
## Evaluation
21+
22+
```
23+
const client = OpenFeature.getClient()
24+
25+
// provide the flag key and a default value which is returned for exceptional conditions.
26+
const flagEval = client.getBooleanValue('<FLAG_KEY>', false)
27+
```

0 commit comments

Comments
 (0)