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
Copy file name to clipboardExpand all lines: README.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
# Unleash React SDK
2
+
3
+
Unleash is a private, secure, and scalable [feature management platform](https://www.getunleash.io/) built to reduce the risk of releasing new features and accelerate software development. This React SDK is designed to help you integrate with Unleash and evaluate feature flags inside your application.
4
+
5
+
You can use this client with [Unleash Enterprise](https://www.getunleash.io/pricing?utm_source=readme&utm_medium=react) or [Unleash Open Source](https://github.com/Unleash/unleash).
This library uses the core [unleash-proxy-client](https://github.com/Unleash/unleash-proxy-client-js) JS client as a base.
17
+
This library uses the core [unleash-js-sdk](https://github.com/Unleash/unleash-js-sdk) client as a base.
12
18
13
19
## Initialize the client
14
20
15
-
*NOTE*: [unleash-proxy](https://github.com/Unleash/unleash-proxy) is in maintenance mode. It is recommend to use the [Frontend API](https://docs.getunleash.io/reference/front-end-api) or [unleash-edge](https://github.com/Unleash/unleash-edge) instead.
21
+
*NOTE*: [unleash-proxy](https://github.com/Unleash/unleash-proxy) is in maintenance mode. It is recommend to use the [Frontend API](https://docs.getunleash.io/reference/front-end-api) or [unleash-edge](https://docs.getunleash.io/reference/unleash-edge) instead.
or [Frontend API Access](https://docs.getunleash.io/reference/front-end-api) token.
23
+
For the following step you will need a [frontend API Token](https://docs.getunleash.io/reference/front-end-api) or [unleash-edge pretrusted token](https://docs.getunleash.io/reference/unleash-edge#pretrusted-tokens).
19
24
20
25
Import the provider like this in your entrypoint file (typically index.js/ts):
21
26
@@ -24,8 +29,8 @@ import { createRoot } from 'react-dom/client';
url:'<unleash-url>/api/frontend', // Your front-end API URL or the Unleash proxy's URL (https://<proxy-url>/proxy)
28
-
clientKey:'<your-token>', // A client-side API token OR one of your proxy's designated client keys (previously known as proxy secrets)
32
+
url:'<unleash-url>/api/frontend', // Your front-end API URL or the Unleash edge URL
33
+
clientKey:'<your-token>', // A frontend token OR one of your unleash-edge pretrusted token
29
34
refreshInterval:15, // How often (in seconds) the client should poll the proxy for updates
30
35
appName:'your-app-name', // The name of your application. It's only used for identifying your application
31
36
};
@@ -48,8 +53,6 @@ To connect this SDK to your Unleash instance's [front-end API](https://docs.getu
48
53
49
54
To connect this SDK to unleash-edge, follow the documentation provided in the [unleash-edge repository](https://github.com/unleash/unleash-edge).
50
55
51
-
To connect this SDK to the [Unleash proxy](https://docs.getunleash.io/reference/unleash-proxy), use the proxy's URL and a [proxy client key](https://docs.getunleash.io/reference/api-tokens-and-client-keys#proxy-client-keys). The [_configuration_ section of the Unleash proxy docs](https://docs.getunleash.io/reference/unleash-proxy#configuration) contains more info on how to configure client keys for your proxy.
52
-
53
56
## Check feature toggle status
54
57
55
58
To check if a feature is enabled:
@@ -350,7 +353,7 @@ The major release is driven by Node14 end of life and represents no other change
350
353
351
354
## Upgrade path from v4 -> v5
352
355
353
-
[FlagContext public interface changed](https://github.com/Unleash/proxy-client-react/commit/b783ef4016dbb881ac3d878cffaf5241b047cc35#diff-825c82ad66c3934257e0ee3e0511d9223db22e7ddf5de9cbdf6485206e3e02cfL20-R20). If you used FlagContext directly you may have to adjust your code slightly to accomodate the new type changes.
356
+
[FlagContext public interface changed](https://github.com/Unleash/unleash-react-sdk/commit/b783ef4016dbb881ac3d878cffaf5241b047cc35#diff-825c82ad66c3934257e0ee3e0511d9223db22e7ddf5de9cbdf6485206e3e02cfL20-R20). If you used FlagContext directly you may have to adjust your code slightly to accomodate the new type changes.
354
357
355
358
## Design philosophy
356
359
This feature flag SDK is designed according to our design philosophy. You can [read more about that here](https://docs.getunleash.io/topics/feature-flags/feature-flag-best-practices).
0 commit comments