Toggle Concepts

Core concepts of the Toggle service

Context

The context is a collection of properties and their values that feature flags use to determine targeting. While only a few properties are required, developers can extend the context with additional, custom properties to enable more complex targeting logic for a toggle.

Targeting

Targeting is the process of returning a value based on specific properties within the evaluated context. For example, a developer might target all users whose email address belongs to a certain domain. Hyphen uses the JSON Logic standard to support rich and complex targeting rules.

Segments

A segment is a reusable set of targeting rules based on context properties that can be applied across multiple feature flags within a project. Segments are useful because they let you define a common audience once and then reuse that audience across many toggles without duplicating logic. For example, “beta testers,” “premium customers,” or “users in Mexico".

This makes targeting more consistent, reduces the chance of errors, and speeds up rollout changes, since updating a segment instantly updates all feature flags that reference it. Segments are especially valuable for maintaining large-scale feature flag systems where multiple teams work on different features but need to share consistent targeting criteria.

Telemetry

Hyphen collects two types of telemetry when you use toggle, Evaluation and Usage.

Evaluations

An evaluation is the result of applying a context to all toggles in a given project. Hyphen evaluates all the toggles at once for performance reasons. There are several layers of caching, invalidated by changes to the context or toggles, that allow Hyphen to provide unparalleled performance. Evaluation is the metric on which an organization is billed.

Usage

Usage telemetry is the consumption of the toggle's value for a given evaluation. This information is usage to help developers determine what toggles are being used and what their values are being evaluated to. This telemetry is collected by our SDKs and may be turned off with SDK options. Doing so will reduce the information available to your developer in the hyphen application. Organization are not billed based on usage metrics.