@openfeature/flagd-provider 0.13.1 → 0.13.3

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 CHANGED
@@ -38,6 +38,7 @@ Options can be defined in the constructor or as environment variables. Construct
38
38
  | selector | FLAGD_SOURCE_SELECTOR | string | - | |
39
39
  | cache | FLAGD_CACHE | string | lru | lru, disabled |
40
40
  | maxCacheSize | FLAGD_MAX_CACHE_SIZE | int | 1000 | |
41
+ | defaultAuthority | FLAGD_DEFAULT_AUTHORITY | string | - | rpc, in-process |
41
42
 
42
43
  #### Resolver type-specific Defaults
43
44
 
@@ -61,7 +62,7 @@ In the above example, the provider expects flagd to be available at `localhost:8
61
62
 
62
63
  Alternatively, you can use socket paths to connect to flagd.
63
64
 
64
- ```
65
+ ```ts
65
66
  OpenFeature.setProvider(new FlagdProvider({
66
67
  socketPath: "/tmp/flagd.socks",
67
68
  }))
@@ -72,7 +73,7 @@ Alternatively, you can use socket paths to connect to flagd.
72
73
  This mode performs flag evaluations locally (in-process).
73
74
  Flag configurations for evaluation are obtained via gRPC protocol using [sync protobuf schema](https://buf.build/open-feature/flagd/file/main:sync/v1/sync_service.proto) service definition.
74
75
 
75
- ```
76
+ ```ts
76
77
  OpenFeature.setProvider(new FlagdProvider({
77
78
  resolverType: 'in-process',
78
79
  }))
@@ -83,7 +84,7 @@ In the above example, the provider expects a flag sync service implementation to
83
84
  In-process resolver can also work in an offline mode.
84
85
  To enable this mode, you should provide a valid flag configuration file with the option `offlineFlagSourcePath`.
85
86
 
86
- ```
87
+ ```ts
87
88
  OpenFeature.setProvider(new FlagdProvider({
88
89
  resolverType: 'in-process',
89
90
  offlineFlagSourcePath: './flags.json',
@@ -93,6 +94,18 @@ To enable this mode, you should provide a valid flag configuration file with the
93
94
  Offline mode uses `fs.watchFile` and polls every 5 seconds for changes to the file.
94
95
  This mode is useful for local development, test cases, and for offline applications.
95
96
 
97
+ ### Default Authority usage (optional)
98
+
99
+ This is useful for complex routing or service-discovery use cases that involve a proxy (e.g., Envoy).
100
+ Please refer to this [GitHub issue](https://github.com/open-feature/js-sdk-contrib/issues/1187) for more information.
101
+
102
+ ```ts
103
+ OpenFeature.setProvider(new FlagdProvider({
104
+ resolverType: 'in-process',
105
+ defaultAuthority: 'b-target-api.service',
106
+ }))
107
+ ```
108
+
96
109
  ### Supported Events
97
110
 
98
111
  The flagd provider emits `PROVIDER_READY`, `PROVIDER_ERROR` and `PROVIDER_CONFIGURATION_CHANGED` events.
@@ -107,9 +120,8 @@ For general information on events, see the [official documentation](https://open
107
120
 
108
121
  ### Flag Metadata
109
122
 
110
- | Field | Type | Value |
111
- | ------- | ------ | ------------------------------------------------- |
112
- | `scope` | string | "selector" set for the associated source in flagd |
123
+ [Flag metadata](https://flagd.dev/reference/flag-definitions/#metadata) is a set of key-value pairs that can be associated with a flag.
124
+ The values come from the flag definition in flagd.
113
125
 
114
126
  ## Building
115
127