Skip to content

Commit 2080315

Browse files
authored
build(deps): Update to @launchdarkly/openfeature-node-server version 0.2.0. (#2)
1 parent c12969e commit 2080315

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
command: |
3636
npm i
3737
npm start | tee output.txt
38-
grep "is true for this user" output.txt || (echo "Flag did not evaluate to expected true value" && exit 1)
38+
grep "is true for this context" output.txt || (echo "Flag did not evaluate to expected true value" && exit 1)

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const sdkKey = '';
88
// Set featureFlagKey to the feature flag key you want to evaluate
99
const featureFlagKey = 'my-boolean-flag';
1010

11-
// Set up the user properties. This user should appear on your LaunchDarkly users dashboard
11+
// Set up the context properties. This context should appear on your LaunchDarkly contexts dashboard
1212
// soon after you run the demo.
1313
// Remember when using OpenFeature to use `targetingKey` instead of `key`.
1414
const context = {
15-
targetingKey: 'example-user-key'
15+
targetingKey: 'example-user-key',
16+
kind: 'user'
1617
};
1718

1819
const ldClient = init(sdkKey);
@@ -23,11 +24,11 @@ const client = OpenFeature.getClient();
2324

2425
const flagValue = await client.getBooleanValue(featureFlagKey, false, context);
2526

26-
console.log(`Feature flag '${featureFlagKey}' is ${flagValue} for this user`);
27+
console.log(`Feature flag '${featureFlagKey}' is ${flagValue} for this context`);
2728

2829
// Here we ensure that the SDK shuts down cleanly and has a chance to deliver analytics
2930
// events to LaunchDarkly before the program exits. If analytics events are not delivered,
30-
// the user properties and flag usage statistics will not appear on your dashboard. In a
31+
// the context properties and flag usage statistics will not appear on your dashboard. In a
3132
// normal long-running application, the SDK would continue running and events would be
3233
// delivered automatically in the background.
3334
await ldClient.flush();

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"author": "LaunchDarkly <team@launchdarkly.com>",
2020
"license": "Apache-2.0",
2121
"dependencies": {
22-
"@launchdarkly/openfeature-node-server": ">= 0.1.6",
22+
"@launchdarkly/openfeature-node-server": ">= 0.2.0",
2323
"@openfeature/js-sdk": "^1.x",
24-
"launchdarkly-node-server-sdk": ">= 6.4.3"
24+
"launchdarkly-node-server-sdk": ">= 7.0.1"
2525
}
2626
}

0 commit comments

Comments
 (0)