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 install
in 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
, modifyQRURL
to be your github pages URL - In
package.json
, modify the "homepage" to point to your github pages URL - In
src/index.js
, modifyCLIENTKEY
to be your own LaunchDarkly client-side SDK key
reactBackgroundColor
: A string flag withgray
,purple
,blue
, andred
as 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
Writer
permissions. Go to the Authorizations page to create it. - Terraform installed
- See the
.tfvars.example
file in the root directory? Rename it to.tfvars
. - Then edit the
.tfvars
file, replacing theaccess_token
andproject_key
values. - 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 start
in the root directory of your project - On your LaunchDarkly dashboard, try turning the
reactQRCode
flag on and off, and serve different colors in thereactBackgroundColor
flag
- When you're ready,
npm run deploy
to deploy to a newgh-pages
branch of your repository - On your GitHub repository, go to Settings > Pages and ensure you're using the
gh-pages
branch in theroot
directory