Skip to content

Commit 92a1143

Browse files
authored
(flags-sdk-launchdarkly): Update README (#1140)
### Description Fixup: Adds a demo URL and updates the experiment key.
1 parent 8181b9b commit 92a1143

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

flags-sdk/launchdarkly/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example uses [LaunchDarkly](https://vercel.com/marketplace/launchdarkly) fo
44

55
## Demo
66

7-
TODO
7+
https://flags-sdk-launchdarkly.vercel.app/
88

99
## How it works
1010

@@ -51,8 +51,8 @@ Be sure to enable the `SDKs using Client-side ID` option for each Feature Flag.
5151

5252
Feature Flags:
5353

54-
- `Summer Sale` (type boolean) with the key `summer-sale` and the variations `true` and `false`. Edit the default targeting rule to serve a percentage rollout with a 50/50 split by `user.key`.
55-
- `Free Delivery` (type boolean) with the key `free-delivery` and the variations `true` and `false`. Edit the default targeting rule to serve a percentage rollout with a 50/50 split by `user.key`.
54+
- `Summer Sale` (type boolean) with the key `summer-sale` and the variations `true` and `false`. Edit the default targeting rule to serve a percentage rollout with a 50/50 split by `user.key`.
55+
- `Free Delivery` (type boolean) with the key `free-delivery` and the variations `true` and `false`. Edit the default targeting rule to serve a percentage rollout with a 50/50 split by `user.key`.
5656
- `Proceed to Checkout` (type string) with the key `proceed-to-checkout` and the following variations:
5757
- Name: `Control`, Value: `blue`
5858
- Name: `Test`, Value: `green`
@@ -78,7 +78,7 @@ Create the `Proceed to Checkout` experiment:
7878
- Metric definition: `Percentage of user units that sent the event, where higher is better`
7979
- Metric name: `Proceed to Checkout Clicked`
8080
- Varaiations: Choose flag `proceed-to-checkout`
81-
- Audience:
81+
- Audience:
8282
- In this experiment: Choose `Custom` and enter `100`%
8383
- Split audience: Choose `Split equally`
8484
- Statistical approach: Default values

flags-sdk/launchdarkly/flags.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
import { ldAdapter, type LDContext } from '@flags-sdk/launchdarkly';
2-
import { flag } from 'flags/next';
3-
import { identify } from './lib/identify';
1+
import { ldAdapter, type LDContext } from '@flags-sdk/launchdarkly'
2+
import { flag } from 'flags/next'
3+
import { identify } from './lib/identify'
44

55
export const showSummerBannerFlag = flag<boolean, LDContext>({
66
key: 'summer-sale',
77
adapter: ldAdapter.variation(),
88
defaultValue: false,
99
identify,
10-
});
10+
})
1111

1212
export const showFreeDeliveryBannerFlag = flag<boolean, LDContext>({
1313
key: 'free-delivery',
1414
adapter: ldAdapter.variation(),
1515
defaultValue: false,
1616
identify,
17-
});
17+
})
1818

1919
export const proceedToCheckoutColorFlag = flag<string, LDContext>({
20-
key: 'proceed-to-checkout',
20+
key: 'proceed-to-checkout-color',
2121
adapter: ldAdapter.variation(),
2222
options: ['blue', 'green', 'red'],
2323
defaultValue: 'blue',
2424
identify,
25-
});
25+
})
2626

2727
export const delayFlag = flag<number>({
2828
key: 'delay',
@@ -37,12 +37,12 @@ export const delayFlag = flag<number>({
3737
{ value: 10_000, label: '10s' },
3838
],
3939
decide() {
40-
return this.defaultValue as number;
40+
return this.defaultValue as number
4141
},
42-
});
42+
})
4343

4444
export const productFlags = [
4545
showFreeDeliveryBannerFlag,
4646
showSummerBannerFlag,
4747
proceedToCheckoutColorFlag,
48-
] as const;
48+
] as const

0 commit comments

Comments
 (0)