React
The React SDK. Works on the client, but also on the server.
Installation
$ npm install --save @progressively/reactUsage (Browser only)
import { ProgressivelyProvider, useFlags } from "@progressively/react";
const FlaggedComponent = () => {
const { flags } = useFlags();
/* ... */
};
const progressivelyProps = {
clientKey: "YOUR_ENVIRONMENT_CLIENT_KEY",
apiUrl: "your url server",
websocketUrl: "your url server for websockets",
};
const YourPage = () => {
return (
<ProgressivelyProvider {...progressivelyProps}>
<FlaggedComponent />
</ProgressivelyProvider>
);
};
Usage (with SSR)
Install the SSR library
Default SSR usage
SSR with sticky user
Last updated