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.
- NOTE: If you receive dependency errors, you can add the
--legacy-peer-depsflag
- 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
config-background-color: A string flag withgray,purple,blue, andredas string variations.config-customer-logo: A string flag with variations containing URLs of images.show-qr-code: booleanrelease-new-ui: A boolean placeholder flag which you can use as a prerequisite for other flagsrelease-header-logo: booleanrelease-astronaut: booleanshow-customer-logo: booleanrelease-heart: 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
terraform.tfvars.examplefile in the root directory? Rename it toterraform.tfvars. - Then edit the
terraform.tfvarsfile, replacing theaccess_tokenandproject_keyvalues. - Run:
terraform initto initialize the configuration - Run:
terraform plan - If that ran with no errors, then run:
terraform apply - 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
show-qr-codeflag on and off, and serve different colors in theconfig-background-colorflag
- 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