Skip to content

App: flags, experiments and analytics

Feature flags, experiments and the events an App records about its own use. Preview keys work and may change in any release (status); the rest are stable. All parts.

Preview. Flags, audiences, experiments, behavior analytics and tablewalk/openfeature work as documented and may change in any 1.x release. See status.

Flags are decision data. Declare defaults in the App, then operate them from the suite provider and Console.

flags: {
newReview: flag.boolean(false, { owner: 'lending' }),
reviewLayout: flag.string('standard', { owner: 'lending', variants: ['standard', 'compact'], safeValue: 'standard' }),
},
auth: { roles: { flagOperator: { label: 'Flag operator', read: ['loan'],
flags: [{ actions: ['view', 'manage', 'killswitch'], environments: ['production'], owners: ['lending'] }] } } },

flag.boolean, flag.string, flag.number and flag.object take a default and options. owner is required, and variants must include the default. Boolean kill switches use false; other types need a safeValue to be killed. tenantManaged: true permits a tenant override, and an App-wide kill still wins. A provider failure falls back to the declared default, so choose it deliberately.

A role’s flags lists capabilities, each with explicit actions, environments, owners and optional ids. view, manage and killswitch are independent, and admin adds no flag powers. A command’s enabledBy: { flag: 'newReview', is: true } gates new attempts; components read flags with useFlags.

An audience says who, once, and flag rules and experiments name it:

audiences: {
partners: { roles: ['broker'], attributes: { emailDomain: ['partner.example'] } },
beta: { rollout: 10, deny: ['acct_42'] },
},

Every condition given must hold: roles, tenants, a proven email’s attributes.emailDomain, and rollout, a stable share salted by the audience’s name, so every flag and experiment naming it reaches the same people. allow and deny list account ids and decide first. A Console rule or an experiment’s eligibility.audiences matches a member of any one named; neither lists roles or tenants itself. Experiments and behavior analytics build on the same declarations.

Key Type Status What it does
analytics object Preview Behavior analytics, off unless declared: the built-in kinds collected, the custom events components may emit, and funnels read over them. Where events are stored is configuration (analytics.store), not the App’s.
Key Type Status What it does
analytics.collect array Preview Built-in kinds recorded: a view or page opening by its id, a command’s outcome at admission, a form step reached and its submit.
Key Type Status What it does
analytics.events object Preview Custom events a component emits through useAnalytics().emit, each with the only fields it may carry. Used in examples/apps/lintel/commands/ledger.ts.
analytics.events.*.fields array Preview Used in examples/apps/tick/app.ts.
Key Type Status What it does
analytics.funnels object Preview Ordered steps a unit passes within a conversion window, counted over the stored events.
analytics.funnels.*.conversionWindow string Preview A whole number and a unit: ‘30 seconds’, ‘5 minutes’, ‘12 hours’, ‘3 days’, ‘2 weeks’.
analytics.funnels.*.steps array Preview
analytics.funnels.*.steps[].command string Preview Used in examples/apps/lintel/app.ts.
analytics.funnels.*.steps[].event string Preview Used in examples/apps/lintel/late-fees.ts.
analytics.funnels.*.steps[].form string Preview Used in examples/apps/tick/app.ts.
analytics.funnels.*.steps[].step string Preview Used in examples/apps/lintel/commands/ledger.ts.
analytics.funnels.*.steps[].view string Preview Used in examples/apps/lintel/app.ts.
analytics.funnels.*.unit "subject" · "visitor" Preview One of subject, visitor. Used in examples/apps/lintel/app.ts.
Key Type Status What it does
audiences object Preview
Key Type Status What it does
audiences.*.allow array Preview
audiences.*.attributes object Preview
audiences.*.attributes.emailDomain array Preview
audiences.*.deny array Preview
audiences.*.roles array Preview
audiences.*.rollout number Preview
audiences.*.tenants Preview
Key Type Status What it does
experiments object Preview
Key Type Status What it does
experiments.*.allocation array Preview
experiments.*.allocation[].value flagValue Preview Used in examples/apps/lintel/commands/ledger.ts.
experiments.*.allocation[].weight number Preview Used in examples/apps/lintel/blueprint.ts.
experiments.*.control flagValue Preview Used in examples/apps/lintel/blueprint.ts.
experiments.*.conversionWindow string Preview A whole number and a unit: ‘30 seconds’, ‘5 minutes’, ‘12 hours’, ‘3 days’, ‘2 weeks’.
experiments.*.deliveryGrace string Preview A whole number and a unit: ‘30 seconds’, ‘5 minutes’, ‘12 hours’, ‘3 days’, ‘2 weeks’.
experiments.*.eligibility object Preview
experiments.*.eligibility.audiences Preview
experiments.*.eligibility.rollout number Preview
experiments.*.endsAt string Preview
experiments.*.guardrails array Preview
experiments.*.guardrails[].conversion string Preview
experiments.*.guardrails[].maxIncrease number Preview
experiments.*.primary object Preview Used in examples/apps/lintel/views.ts.
experiments.*.primary.conversion string Preview
experiments.*.startsAt string Preview
experiments.*.unit "subject" · "visitor" Preview One of subject, visitor. Used in examples/apps/lintel/app.ts.
experiments.*.version string Preview
Key Type Status What it does
flags object Preview
Key Type Status What it does
flags.*.default flagValue Preview
flags.*.expiry string Preview
flags.*.owner string Preview
flags.*.safeValue flagValue Preview One of false.
flags.*.tenantManaged boolean Preview
flags.*.type "boolean" · "string" · "number" · "object" Preview One of boolean, number, object, string. Used in examples/apps/lintel/blueprint.ts.
flags.*.variants array Preview
Key Type Status What it does
track "none" · "receipts" · "audit" Stable What the App’s commands keep unless one says otherwise: none, receipts (a retried request is answered once) or audit (the receipt and every change). A door that retries (the App API, MCP, a job) keeps at least receipts. One of audit, none, receipts.