Getting started

Welcome! Let's get started. We'll do the following:

  1. Create your first flag.

  2. Install the Reflag SDK.

  3. Set flag access rules and/or remote config.

  4. Enable Toolbar for local testing

  5. Monitor your flag launch.

1. Create your first flag

Now let's create your first flag.

npx @reflag/cli new

See CLI docs.

Next, let's set up a Reflag SDK for your language and framework.

2. Install the Reflag SDK

Find the supported languages below:

Code example for React

If you've installed the React SDK and created a flag called my-new-flag, getting started looks like this:

You can now use isEnabled to gate access to the flag.

3. Set access rules

Head back to your dashboardarrow-up-right, select your flag, and open the Access tab.

From here, you can define segments, companies, and users that will access your flag.

4. Enable Toolbar for local testing

In the frontend SDK, enable the Toolbar to toggle flags locally.

In the React SDK, you enable it with toolbar:

5. Monitor your flag launch

On the Monitor tab, you can track real-time flag exposure, adoption, and user feedback.

Track exposure

The Exposed chart shows companies that have been exposed to your flag. This means they were checked for flag access against your targeting rules and the check returned enabled.

Track adoption

To track whether exposed companies are also interacting with your flag, use track.

See the code example below.

Get user feedback

To get feedback from your users, you can add a static "Feedback" button or you can trigger a survey, at the right time.

Here's an example with a static feedback button.

Get support

Last updated

Was this helpful?