Skip to content

Lab E - Feature Flags

Lab 5 - Feature Flags

Summary: Build and deploy your first feature flag 

Learning Objective(s):

  • Create a Feature Flag

  • Create an SDK key

  • Deploy application that uses Flag/SDK Key

  • Toggle Feature Flag to enable/disable feature

Steps

Create the SDK Key

  1. From the left hand side menu under Feature Flags,  select environments

  2. From the list select the prod environment

  3. Click + New SDK Key, configure as follows and click Create

InputValueNotes
Namedk
Key Typeclient
  1. Copy the secret to use later. Note that the key will be redacted once you leave the page.

  2. From the left hand side menu select Project settings

  3. From the resources available click on the Variables

  4. Modify the sdk variable and copy in the key

InputValueNotes
Namesdk
ValueSDK Key copied from previous step
  1. Click Save

Create the Flag

  1. From the left hand menu, go to Feature FlagsFeature Flags

  2. Click + New Feature Flag, configure as follows and click Save and Close.

InputValueNotes
TypeBoolean
Namewebinarff
Variation Settings
Name (first one)Show Offer
Name (second one)Hide Offer
If the flag is Enabled, serveShow Offer
  1. Enable the flag by clicking on the Flag is Disabled button and click Save

  2. Run the pipeline created in previous steps

Change the Flag via the UI

  1. From the left hand menu in Harness, go to Feature FlagsTarget Management

  2. Select the target shown in the list. If target is not shown, create the target manually

InputValueNotes
Namewebinar
Identifierwebinar
  1. Click Add Flag, toggle webinarff, set the variation to Show Offer, then click on Add 1 Flags

  2. Note that your application now displays a special offer

  3. For your target, set the variation to Hide Offer and click Save Chances

  4. Note that your application now does NOT display the special offer