Concepts

Flags and Values

Model each release decision with the smallest flag type that expresses the behavior you need to control.

Documented flag types today

The current public SDKs and product pages document four flag types: boolean, string, number, and json. Each flag has a key, a name, a target value, and optional rules that can override that target for matching contexts.

Boolean

Use for kill switches, feature gating, and any strict on or off decision.

String

Use for variants such as theme names, experiment labels, or remote configuration modes.

Number

Use for thresholds, counts, quotas, and timing values your application reads at runtime.

JSON

Use for structured configuration — an object or array — that a single string or number can't express cleanly.

Typical values by type typescript

const checkoutEnabled = await zenmanage.flags().single('new-checkout', false);
const theme = await zenmanage.flags().single('checkout-theme', 'classic');
const maxItems = await zenmanage.flags().single('max-items-per-page', 100);
const retryPolicy = await zenmanage.flags().single('checkout-retry-policy', {});

console.log(checkoutEnabled.asBool(), theme.asString(), maxItems.asNumber(), retryPolicy.asJson());

JSON values

A json flag's value is any valid JSON document — an object or an array. It's stored and served in compact form (no extra whitespace), so two values that differ only in formatting are treated as the same value. On the wire, a json value is wrapped the same way every other type is: {"json": {...}} alongside {"boolean": ...}, {"string": ...}, and {"number": ...} — see the Public API reference for the full response shape.

To keep evaluation fast and environment payloads predictable, json values are capped at 64 KB and 10 levels of nesting. A value over either limit is rejected at write time with the limit and the actual size named in the error — nothing over-limit ever reaches a connected SDK.

Defaults work the same way as any other type: pass an object or array as the inline default and the SDK infers a json flag, falling back to that default if Zenmanage is unreachable or the flag doesn't exist. An application default of {} or [] is a safe empty fallback for most call sites.

A flag is more than a raw value

The target value is what a flag resolves to when no rules match. Rules and rollouts can override that target for specific contexts. Default values in your application sit outside Zenmanage and act as your last-resort fallback when a flag cannot be fetched or does not exist.

  • Target value: the fallback value served from Zenmanage when no rule matches.
  • Rule value: the value served when a rule matches the current context.
  • Application default: the value your code uses when the flag is unavailable.

That layering is what lets you combine safe rollbacks in application code with flexible rollout behavior in the platform.

Choose the simplest primitive first

If a feature is only enabled or disabled, use a boolean. Only move to string or number values when you need variants or dynamic configuration, and reach for json only when the config genuinely needs structure — a single string or number is easier to reason about during incidents and cleanup.