@configdirector/openfeature-server-provider 1.11.1 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/configdirector-openfeature-server-provider.cjs +1 -1
- package/dist/configdirector-openfeature-server-provider.d.cts +28 -8
- package/dist/configdirector-openfeature-server-provider.d.cts.map +1 -1
- package/dist/configdirector-openfeature-server-provider.d.mts +28 -8
- package/dist/configdirector-openfeature-server-provider.d.mts.map +1 -1
- package/dist/configdirector-openfeature-server-provider.mjs +2 -2
- package/dist/configdirector-openfeature-server-provider.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,22 @@ const client = OpenFeature.getClient();
|
|
|
23
23
|
const newCheckout = await client.getBooleanValue("new-checkout", false);
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
`setProviderAndWait` rejects when no config arrives from ConfigDirector within the connection timeout, which is 3 seconds unless you set `connection.timeout` in milliseconds. Flags then resolve to their in-code default values until config arrives. To start without waiting for ConfigDirector, set the provider with `setProvider` instead:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
OpenFeature.setProvider(new ConfigDirectorProvider("YOUR-SERVER-SDK-KEY"));
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or catch the rejection:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
try {
|
|
36
|
+
await OpenFeature.setProviderAndWait(new ConfigDirectorProvider("YOUR-SERVER-SDK-KEY"));
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.warn("Starting on in-code default values until ConfigDirector sends config:", error);
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
26
42
|
Full details are in the [official documentation](https://docs.configdirector.com/sdks/server/openfeature-node).
|
|
27
43
|
|
|
28
44
|
## Test your code
|