[ Web Proxy ]
URL:
Viewing: https://developers.cloudflare.com/flagship/binding/types/ [Back]  [Original]

Types Cloudflare Flagship docsSkip to content
SearchCtrlKLog in
  1. Home
  2. /Flagship
  3. /Binding API
  4. /Types

Types

Last updated Jun 24, 2026Copy as MarkdownView as MarkdownAgent setup
OverviewFlagshipFlagshipEvaluationContextFlagshipEvaluationDetails

The Flagship binding uses the following TypeScript types. These are available from the @cloudflare/workers-types package after running npx wrangler types.

Flagship

The binding type. Each Flagship binding in your Wrangler configuration is typed as Flagship on the Env interface.

interface Env {
	FLAGS: Flagship;
}

Refer to the methods reference for the full list of evaluation methods available on the binding.

FlagshipEvaluationContext

A record of attribute names to values passed for targeting rules. Use this to provide user attributes such as user ID, country, or plan type.

type FlagshipEvaluationContext = Record<string, string | number | boolean>;

FlagshipEvaluationDetails

Returned by the *Details methods. Contains the evaluated value and metadata about how Flagship resolved the flag.

interface FlagshipEvaluationDetails<T> {
	flagKey: string;
	value: T;
	variant?: string;
	reason?: string;
	errorCode?: string;
}
Property Type Description
flagKey string The key of the evaluated flag.
value T The resolved flag value.
variant string The name of the matched variant, if any.
reason string Why the flag resolved to this value (for example, "TARGETING_MATCH" or "DEFAULT").
errorCode string An error code if evaluation failed (for example, "TYPE_MISMATCH" or "GENERAL").

Refer to evaluation reasons and error codes for the full list of possible values.

PreviousOverviewNextMethods

Was this helpful?

YesNo
Edit pageReport issue
[]

Web Proxy Viewer  |  New URL  |  Original Page