Install react-flagpack
mainInstall the package via npm. Note that react-flagpack requires files to be injected into your project's static/public folder. The package includes a CLI to automate this, but you must configure your package.json to execute it.
To ensure the assets are correctly placed, add a postinstall script to your package.json. If your package manager does not run postinstall automatically, you may need to run the command manually.
For Gatsby projects, you must pass the --framework gatsby flag to the CLI. For other frameworks like NextJS, create-react-app, or Remix, the default configuration is sufficient.
$ npm install react-flagpack --save{
"scripts": {
"postinstall": "react-flagpack"
},
"dependencies": {
"react-flagpack": "^2.0.5"
}
}