Skip to content

Commit ae20bc8

Browse files
adams85Adam Simon
andauthored
chore(config-cat): Update ConfigCat providers to use the new ConfigCat SDK (#1371)
Signed-off-by: Adam Simon <[email protected]> Co-authored-by: Adam Simon <[email protected]>
1 parent ef2869f commit ae20bc8

17 files changed

+744
-591
lines changed

libs/providers/config-cat-web/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ The OpenFeature SDK is required as peer dependency.
1414

1515
The minimum required version of `@openfeature/web-sdk` currently is `1.0.0`.
1616

17-
The minimum required version of `configcat-js-ssr` currently is `8.4.3`.
17+
The minimum required version of `@configcat/sdk` currently is `1.0.1`.
1818

1919
```
20-
$ npm install @openfeature/web-sdk configcat-js-ssr
20+
$ npm install @openfeature/web-sdk @configcat/sdk
2121
```
2222

2323
## Usage
2424

25-
The ConfigCat provider uses the [ConfigCat JavaScript SSR SDK](https://configcat.com/docs/sdk-reference/js-ssr/).
25+
The ConfigCat provider uses the [ConfigCat Browser (JavaScript) SDK](https://configcat.com/docs/sdk-reference/js/browser/).
2626

2727
It can be created by passing the ConfigCat SDK options to ```ConfigCatWebProvider.create```.
28-
The available options can be found in the [ConfigCat JavaScript SSR SDK](https://configcat.com/docs/sdk-reference/js-ssr/#creating-the-configcat-client).
28+
The available options can be found in the [ConfigCat JavaScript SSR SDK](https://configcat.com/docs/sdk-reference/js/browser/#creating-the-configcat-client).
2929

3030
The ConfigCat Web Provider only supports the `AutoPolling` mode because it caches all evaluation data to support synchronous evaluation of feature flags.
3131

@@ -54,7 +54,7 @@ await OpenFeature.clearProviders();
5454
```javascript
5555
import { OpenFeature } from "@openfeature/web-sdk";
5656
import { ConfigCatWebProvider } from '@openfeature/config-cat-web-provider';
57-
import { createConsoleLogger, LogLevel } from 'configcat-js-ssr';
57+
import { createConsoleLogger, LogLevel } from '@configcat/sdk';
5858

5959
// Create and set the provider.
6060
const provider = ConfigCatWebProvider.create('<sdk_key>', {
@@ -99,7 +99,7 @@ User:
9999

100100
```json
101101
{
102-
"targetingKey": "test",
102+
"targetingKey": "userId",
103103
"email": "email",
104104
"country": "country",
105105
"customString": "customString",
@@ -125,10 +125,11 @@ User:
125125

126126
```json
127127
{
128-
"identifier": "test",
128+
"identifier": "userId",
129129
"email": "email",
130130
"country": "country",
131131
"custom": {
132+
"targetingKey": "userId",
132133
"customString": "customString",
133134
"customBoolean": "true",
134135
"customNumber": 1,

libs/providers/config-cat-web/package-lock.json

Lines changed: 217 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)