You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: use "domain" instead of "clientName" (#826)
## This PR
- adds support for domains
- removes named clients
---------
Signed-off-by: Michael Beemer <[email protected]>
Signed-off-by: Michael Beemer <[email protected]>
Copy file name to clipboardExpand all lines: packages/react/README.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ The OpenFeature React SDK adds React-specific functionality to the [OpenFeature
42
42
43
43
In addition to the feature provided by the [web sdk](https://openfeature.dev/docs/reference/technologies/client/web), capabilities include:
44
44
45
-
-[Multiple Providers and Scoping](#multiple-providers-and-scoping)
45
+
-[Multiple Providers and domains](#multiple-providers-and-domains)
46
46
-[Re-rendering with Context Changes](#re-rendering-with-context-changes)
47
47
-[Re-rendering with Flag Configuration Changes](#re-rendering-with-flag-configuration-changes)
48
48
-[Suspense Support](#suspense-support)
@@ -130,15 +130,16 @@ const {
130
130
} =useBooleanFlagDetails('new-message', false);
131
131
```
132
132
133
-
### Multiple Providers and Scoping
133
+
### Multiple Providers and Domains
134
134
135
-
Multiple providers and scoped clients can be configured by passing a `clientName` to the `OpenFeatureProvider`:
135
+
136
+
Multiple providers can be used by passing a `domain` to the `OpenFeatureProvider`:
136
137
137
138
```tsx
138
-
// Flags within this scope will use the a client/provider associated with `myClient`,
139
+
// Flags within this domain will use the a client/provider associated with `my-domain`,
139
140
function App() {
140
141
return (
141
-
<OpenFeatureProviderclientName={'myClient'}>
142
+
<OpenFeatureProviderdomain={'my-domain'}>
142
143
<Page></Page>
143
144
</OpenFeatureProvider>
144
145
);
@@ -148,9 +149,11 @@ function App() {
148
149
This is analogous to:
149
150
150
151
```ts
151
-
OpenFeature.getClient('myClient');
152
+
OpenFeature.getClient('my-domain');
152
153
```
153
154
155
+
For more information about `domains`, refer to the [web SDK](https://github.com/open-feature/js-sdk/blob/main/packages/client/README.md).
156
+
154
157
### Re-rendering with Context Changes
155
158
156
159
By default, if the OpenFeature [evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context) is modified, components will be re-rendered.
0 commit comments