Feature Flags

What are feature flags?

Feature flags are toggles that control whether a piece of code is active without redeploying your application. They let you ship code to production at any time and decide separately when (and for whom) that code actually runs.

How DeployRamp flags work

When your application starts, the DeployRamp SDK fetches the current flag configuration from the flags service. After the initial fetch, the SDK maintains a WebSocket connection so it receives real-time updates whenever a flag changes. This means rollout changes, kill-switches, and segment updates take effect across your fleet in seconds, no restart required.

Flag evaluation is local. Once the SDK has the flag data, every call to flag() resolves in sub-millisecond time with no network call. Your hot path stays fast.

How flags are created

Flags can be created in two ways:

  • Automatically: when the DeployRamp AI detects risky code in a pull request, it wraps the change in a feature flag and adds it to the PR.
  • Manually: from the DeployRamp dashboard, where you can create and configure flags at any time.

Anatomy of a flag

Every flag has the following properties:

  • Name: a unique identifier used in code (e.g. new-checkout).
  • Enabled state: whether the flag is active at all.
  • Rollout percentage: what fraction of users see the new path (0–100%).
  • Segments: optional targeting rules that let you roll out to specific groups of users independently.

Example

A simple flag evaluation using the DeployRamp TypeScript SDK:

import { flag } from "@deployramp/sdk";

if (flag("new-checkout")) {
  renderNewCheckout();
} else {
  renderOldCheckout();
}

The flag() function returns true or false synchronously. The SDK already has the flag data in memory, so there is no await and no latency cost.

We use cookies to analyze site usage and improve your experience.