Skip to main content

Installation & configuration

How to install

You can install ReactJS integration package by running the following command:

With yarn:

$ yarn add flaghub-reactjs

With npm:

$ npm install flaghub-reactjs

How to configure


The first thing to do is to initialize the package with your configurations at the top of your main file.

import React from 'react';
import ReactDOM from 'react-dom/client';
import { initializeFlaghub } from "flaghub-reactjs";
import App from './App.tsx'

apiKey: "YOUR_API_KEY",
workspaceId: "YOUR_WORKSPACE_ID",

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<App />

You can find how to retrieve your workspace ID and generate an API key here


The second thing to do is to wrap our provider around your highest app component.

import { FlaghubProvider } from "flaghub-reactjs";

function App() {
return <FlaghubProvider>...</FlaghubProvider>;

export default App;