Skip to content

Commit

Permalink
fix(config-cat-web): Fix code examples in README.md (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
adams85 authored Sep 2, 2024
1 parent f992e34 commit 0b6179b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libs/providers/config-cat-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ $ npm install @openfeature/client-sdk configcat-js-ssr

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

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

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

### Example using the default configuration

```javascript
import { ConfigCatProvider } from '@openfeature/config-cat-web-provider';
import { ConfigCatWebProvider } from '@openfeature/config-cat-web-provider';

const provider = ConfigCatProvider.create('<sdk_key>');
const provider = ConfigCatWebProvider.create('<sdk_key>');
OpenFeature.setProvider(provider);
```

### Example using different polling options and a setupHook

```javascript
import { ConfigCatProvider } from '@openfeature/config-cat-web-provider';
import { ConfigCatWebProvider } from '@openfeature/config-cat-web-provider';

const provider = ConfigCatProvider.create('<sdk_key>', {
const provider = ConfigCatWebProvider.create('<sdk_key>', {
setupHooks: (hooks) => hooks.on('clientReady', () => console.log('Client is ready!')),
});

Expand Down

0 comments on commit 0b6179b

Please sign in to comment.