@@ -8,11 +8,12 @@ const sdkKey = '';
8
8
// Set featureFlagKey to the feature flag key you want to evaluate
9
9
const featureFlagKey = 'my-boolean-flag' ;
10
10
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
12
12
// soon after you run the demo.
13
13
// Remember when using OpenFeature to use `targetingKey` instead of `key`.
14
14
const context = {
15
- targetingKey : 'example-user-key'
15
+ targetingKey : 'example-user-key' ,
16
+ kind : 'user'
16
17
} ;
17
18
18
19
const ldClient = init ( sdkKey ) ;
@@ -23,11 +24,11 @@ const client = OpenFeature.getClient();
23
24
24
25
const flagValue = await client . getBooleanValue ( featureFlagKey , false , context ) ;
25
26
26
- console . log ( `Feature flag '${ featureFlagKey } ' is ${ flagValue } for this user ` ) ;
27
+ console . log ( `Feature flag '${ featureFlagKey } ' is ${ flagValue } for this context ` ) ;
27
28
28
29
// Here we ensure that the SDK shuts down cleanly and has a chance to deliver analytics
29
30
// 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
31
32
// normal long-running application, the SDK would continue running and events would be
32
33
// delivered automatically in the background.
33
34
await ldClient . flush ( ) ;
0 commit comments