This project was bootstrapped with Create React App.
Want to use GitHub Pages to publish your own copy of this? You've come to the right place!
- Fork this repository
- Clone the new repository to your local machine, cloud editor, or whatever
- Run
npm installin your local root directory of the project- NOTE: Due to an outstanding issue with Webpack and version 17+ of Node, you must use Node version 16.X or below.
- In your GitHub repository, go to Settings > Pages and create a GitHub Page. Copy the URL of your GitHub Page, for use in the next section.
- In
src/components/qrCode.js, modifyQRURLto be your github pages URL - In
package.json, modify the "homepage" to point to your github pages URL - In
src/index.js, modifyCLIENTKEYto be your own LaunchDarkly client-side SDK key
reactBackgroundColor: A string flag withgray,purple,blue, andredas string variations.reactCustomerLogo: A string flag with variations containing URLs of images.reactQRCode: booleanreactParentBrand: booleanreactChildHeaderLogo: booleanreactChildToggle: booleanreactShowCustomerLogo: booleanreactShowHeart: boolean
The project React QR Demo exists on the LD Production account with all the necessary flags. You can add a new environment for yourself.
If you want to create a new project with all the right flags, then you can either use the LaunchDarkly Terraform integration to set all the flags up in one go (see below), or do it manually using the list above.
- Ensure that you have:
- An empty LaunchDarkly project, ready for some funky fresh flags
- An API access token with
Writerpermissions. Go to the Authorizations page to create it. - Terraform installed
- See the
.tfvars.examplefile in the root directory? Rename it to.tfvars. - Then edit the
.tfvarsfile, replacing theaccess_tokenandproject_keyvalues. - Run:
terraform plan -var-file=".tfvars" - If that ran with no errors, then run:
terraform apply -var-file=".tfvars" - Go enjoy your lovely new flags!
- To test that it's working locally, run
npm startin the root directory of your project - On your LaunchDarkly dashboard, try turning the
reactQRCodeflag on and off, and serve different colors in thereactBackgroundColorflag
- When you're ready,
npm run deployto deploy to a newgh-pagesbranch of your repository - On your GitHub repository, go to Settings > Pages and ensure you're using the
gh-pagesbranch in therootdirectory