Skip to content

Commit b11ce39

Browse files
btthomassameerank
authored andcommitted
docs: correct browser provider examples
1 parent 9a88e52 commit b11ce39

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ import { OpenFeature } from '@openfeature/web-sdk'
2323

2424
// Initialize the provider
2525
const provider = new DatadogProvider({
26+
applicationId: 'your-datadog-application-id',
2627
clientToken: 'your-datadog-client-token',
2728
enableExposureLogging: true,
2829
enableFlagEvaluationTracking: true,
2930
site: 'datadoghq.com',
3031
})
3132

3233
// Set the provider
33-
await OpenFeature.setProvider(provider)
34+
await OpenFeature.setProviderAndWait(provider)
3435

3536
// Get a client and evaluate flags
3637
const client = OpenFeature.getClient()

packages/browser/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ import { OpenFeature } from '@openfeature/web-sdk'
1616

1717
// Initialize the provider
1818
const provider = new DatadogProvider({
19+
applicationId: 'your-datadog-application-id',
1920
clientToken: 'your-datadog-client-token',
2021
enableExposureLogging: true,
2122
enableFlagEvaluationTracking: true,
2223
site: 'datadoghq.com',
2324
})
2425

2526
// Set the provider
26-
await OpenFeature.setProvider(provider)
27+
await OpenFeature.setProviderAndWait(provider)
2728

2829
// Get a client and evaluate flags
2930
const client = OpenFeature.getClient()
@@ -119,6 +120,7 @@ The full-featured default entry point supports both precomputed and rules-based
119120

120121
```javascript
121122
import { configurationFromString, DatadogProvider, getPrecomputedContext } from '@datadog/openfeature-browser'
123+
import { OpenFeature } from '@openfeature/web-sdk'
122124

123125
const configuration = configurationFromString(wire)
124126
const context = getPrecomputedContext(configuration)

0 commit comments

Comments
 (0)