Implement a feature flag in your application

Learn the basics of how to implement feature flags in your code.

When you add a feature flag to a story in Atono, a developer also needs to add the flag to your application’s code before it can control the feature. Atono provides code samples in different languages to help with this implementation.

This topic assumes you’ve already installed and initialized an Atono SDK. For setup instructions, see Get started with the Atono SDK.



Get a code sample

  1. In the story details panel, click the name of the feature flag.
  2. On the flag's configuration screen, click View code sample.
  3. In the Implement feature flag dialog, select the language or framework you're using:
    • JavaScript
    • React
    • Java
  4. Click Copy code.
  5. Click Done or X to close the dialog.

Use the code sample to add the flag evaluation to the functionality you want to control in your application. The generated sample includes the correct feature flag name, so you can use it directly in your application code.

For information on evaluating the flag, providing customer or location context, and choosing a fallback value, see Feature flags in the Atono SDK documentation.



Find the environment key

The Atono SDK uses an environment key to connect your application to an Atono environment. If you need to find or copy an environment key, you can access it from a story or the Feature flags list.

From a story:

  1. In the story details panel, click the name of the feature flag.
  2. On the flag's configuration screen, click View code sample.
  3. In the Implement feature flag dialog, click Environment keys.

From the Feature flags list:

  1. Click the name of the feature flag in the list.
  2. Click Environment keys.

Either option takes you to the Environments page, where you can copy the key for the environment you want to use.




Did this page help you?