Skip to content

Commit d128211

Browse files
SME Review
Co-authored-by: Emiliano Sanchez <[email protected]>
1 parent 710d1ca commit d128211

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

docs/feature-management-experimentation/20-sdks-and-infrastructure/openfeature/nodejs-sdk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ If you are using an SDK API key:
5151
const OpenFeature = require('@openfeature/server-sdk').OpenFeature;
5252
const OpenFeatureSplitProvider = require('@splitsoftware/openfeature-js-split-provider').OpenFeatureSplitProvider;
5353

54-
const authorizationKey = '<YOUR_AUTH_KEY>'
54+
const authorizationKey = '<YOUR_SERVER_SIDE_SDK_KEY>'
5555
const provider = new OpenFeatureSplitProvider(authorizationKey);
5656
OpenFeature.setProvider(provider);
5757
```
@@ -66,7 +66,7 @@ const OpenFeature = require('@openfeature/server-sdk').OpenFeature;
6666
const SplitFactory = require('@splitsoftware/splitio').SplitFactory;
6767
const OpenFeatureSplitProvider = require('@splitsoftware/openfeature-js-split-provider').OpenFeatureSplitProvider;
6868

69-
const authorizationKey = '<YOUR_AUTH_KEY>'
69+
const authorizationKey = '<YOUR_SERVER_SIDE_SDK_KEY>'
7070
const splitFactory = SplitFactory({core: {authorizationKey}});
7171
const provider = new OpenFeatureSplitProvider(splitFactory);
7272
OpenFeature.setProvider(provider);

docs/feature-management-experimentation/20-sdks-and-infrastructure/openfeature/web-sdk.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@ import { OpenFeatureSplitProvider } from '@splitsoftware/openfeature-web-split-p
4848

4949
const splitFactory = SplitFactory({
5050
core: {
51-
authorizationKey: '<YOUR_AUTH_KEY>'
51+
authorizationKey: '<YOUR_CLIENT_SIDE_SDK_KEY>'
52+
key: '<TARGETING_KEY>'
5253
}
5354
});
5455
const provider = new OpenFeatureSplitProvider(splitFactory);
55-
OpenFeature.setProvider(provider);
56+
57+
// Wait for the default SDK client for '<TARGETING_KEY>' to be ready
58+
await OpenFeature.setProviderAndWait(provider);
5659
```
5760

5861
## Construct an evaluation context
@@ -66,7 +69,7 @@ const context: EvaluationContext = {
6669
targetingKey: '<TARGETING_KEY>',
6770
trafficType: 'account'
6871
};
69-
OpenFeature.setContext(context)
72+
await OpenFeature.setContext(context)
7073
```
7174

7275
## Evaluate with details
@@ -94,7 +97,7 @@ const context = {
9497
coupon: 'WELCOME10'
9598
};
9699

97-
OpenFeature.setContext(context);
100+
await OpenFeature.setContext(context);
98101
const booleanTreatment = client.getBooleanDetails('boolFlag', false);
99102
```
100103

@@ -116,7 +119,7 @@ For example:
116119
const context = { targetingKey: 'user-123', trafficType: 'account' }
117120
const details = { value: 19.99, properties: { plan: 'pro', coupon: 'WELCOME10' }}
118121

119-
client.setEvaluationContext(context)
122+
await client.setContext(context)
120123
client.track('checkout.completed', details)
121124
```
122125

0 commit comments

Comments
 (0)