Skip to content

Cloudflare Flagship can now target flags on nested user data

Flagship feature flag evaluation accepts nested objects, arrays and null, so you can target on a user profile or tag list without flattening it first.

Source: Cloudflare

Cloudflare’s Flagship, its feature flag platform, now accepts nested objects, arrays and null in evaluation context. Before this, targeting a flag on anything beyond flat key-value pairs meant flattening your data first.

Now you can pass a user profile and tag list straight through:

const enabled = await env.FLAGS.getBooleanValue("new-checkout", false, {
  targetingKey: "user-42",
  profile: { plan: "enterprise" },
  tags: ["beta", "early-access"],
});

Targeting rules can then use dot-separated paths like profile.plan, plus has and not_has for array membership, and percentage rollouts can key off a nested identifier such as profile.id. The change reaches the Workers binding, the REST evaluation API, and the TypeScript, Python and Go OpenFeature SDKs from version 0.6.0, which switch to a POST request automatically when context needs it.

Why it matters: flag targeting usually forces a choice between a flat context object and writing custom flattening logic before every evaluation call. Passing your existing application data structures straight in removes that step, and the nested percentage-rollout support means consistent assignment doesn’t depend on a flat ID field existing in the first place.

Share

More from The Wire

All briefs