Set up Hypertune

1. Create a project

Sign up at app.hypertune.com/register and create a new project.

2. Create a feature flag

Hypertune uses GraphQL for its schema definition language.

Define a new feature flag called showNewEditor on the Root type:

type Root {
  exampleFlag: Boolean!
  showNewEditor: Boolean!
}

3. Set up flag targeting

Switch to the Logic tab and select the new "Show New Editor" flag.

Add an "If / Else" expression with a rule that enables the flag if context > user > id is test_id and disables it by default.

4. Preview flag values

Switch to the Preview tab and enter the following query:

query TestQuery {
  root {
    showNewEditor
  }
}

Hypertune uses GraphQL for its query language. In the Result tab, you can see the flag that matches your query, including all of its logic.

Now pass the context argument containing the user object in the query:

query TestQuery {
  root(
    context: {
      environment: "DEVELOPMENT",
      user: {
        id: "test_id"
        name: "Test"
        email: "test@test.com"
      }
    }
  ) {
    showNewEditor
  }
}

Now your flag logic has been reduced, i.e. the "If / Else" expression has been replaced with its result. Try entering different user IDs to see how the result changes.

5. Save your changes

Click "Save and activate" in the navigation bar.

6. Get flags in your code

Follow one of the quickstarts below to get feature flags in your code:

Last updated