Repository navigation
Backlog
Backlog
Copy link
Description
Updated with Cloudflare Flagship in mind.
Summary
Add inferred feature flags via void/flags backed by Cloudflare Flagship—allowing developers and AI agents to define flags directly in code while Void automatically provisions the Flagship app/binding, registers inferred flags, generates TypeScript types, and exposes toggle controls in the CLI and Platform UI.
Why This Fits Void
Void already turns code imports (void/db, void/kv, void/env) into provisioned Cloudflare bindings with zero boilerplate. Now that Cloudflare has a native, OpenFeature-compatible Workers binding for feature flags (Flagship), void/flags can follow the exact same pattern:
- Zero-config Flagship provisioning: Importing
void/flagsautomatically creates the Flagship app, wires up the Workers binding (env.FLAGS), and syncs inferred flag definitions—no manual dashboard setup orwranglerconfiguration required. - Built for AI agent workflows: Coding agents routinely wrap new features in flags to safely ship to production. Static AST inference prevents "orphan" flags in code that haven't been registered in the control plane yet.
- OpenFeature standard: Because Flagship is natively built on OpenFeature, developers get a clean, portable API with sub-millisecond edge evaluation and zero vendor lock-in.
Proposed DX
// routes/api/checkout.ts
import { defineHandler } from 'void';
import { flags } from 'void/flags';
export const POST = defineHandler(async ({ request }) => {
// Statically inferred: key = 'new-checkout', type = boolean, default = false
const useNewCheckout = await flags.getBoolean('new-checkout', false, {
targetingKey: request.headers.get('x-user-id') ?? undefined,
});
return { flow: useNewCheckout ? 'v2' : 'v1' };
});Core Capabilities
- Static Inference & Typegen: Build/dev scanning extracts flag keys, inferred variant types (
boolean,string,number,json), and default values—generating.void/flags.d.tsfor autocomplete and catching type mismatches if a key is reused with conflicting default types. - Automatic Flag Sync & Local Dev: Defaults to code-defined fallbacks in
void dev(with local overrides via CLI or env), whilevoid deploysyncs newly discovered flags to Flagship without overwriting existing targeting rules or rollout percentages. - CLI & Platform Controls:
void flags list/void flags set <key> <value>for quick terminal toggles and kill switches.- Surface Flagship status and deep-links/toggles inside the Void Platform UI alongside inferred DBs and KVs.
- Stale-flag warnings when a flag exists in Flagship but no longer appears in the AST.
Open Questions for Maintainers
- Should
void/flagsexpose thin wrappers (flags.getBoolean(...)) around the Flagship binding, or directly expose an initialized OpenFeature client? - Note: Cloudflare Flagship is currently in beta—would you want to gate
void/flagsbehind an experimental flag until Flagship reaches GA?
Drafted with assistance from Gemini.
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Priority
None yet
Activity
cpojer commentedon Dec 1, 2026
I think it would be great to use Flagship if possible: https://developers.cloudflare.com/flagship/ – but with a Void-like API.
mfulton26 commentedon Dec 1, 2026
Yes, perfect. I did not know Flagship was a thing. Void APIs also help developers discover things like this. Thank you.