Skip to content

Entitlements vs feature flags: how to gate features by plan

Should you gate paid features with feature flags or an entitlements system? The difference, three patterns with tested code for plan-based flags, and how Stripe Entitlements, Stigg, Schematic, Reflag and Unleash handle plans.

7 min read

Short answer: An entitlement says what a customer has paid for; a feature flag says whether a feature is switched on for someone right now. Keep the source of truth for plans in your billing or entitlements system, pass the plan to your flag tool as an attribute, and use flags to release plan features gradually or grant temporary exceptions.

What is the difference between entitlements and feature flags?

Entitlement Feature flag
Question "Has this customer paid for this?" "Is this on for this user right now?"
Source of truth Billing: plans, subscriptions, contracts The flag tool's rules
Changes when The customer upgrades, downgrades, cancels or renews A team member edits a rule or a rollout percentage
Lifetime As long as the plan exists Release flags are temporary; permission flags are permanent
Limits and usage Often: seats, API calls, credits Usually not; flags are on/off or variants
Mistakes cost Revenue: free access to paid features, or paying customers locked out A feature shown to the wrong users

Unleash names the overlap directly: its flag types include Permission, to "control feature access based on user roles or entitlements", with a permanent expected lifetime, next to Release flags expected to last 40 days (Unleash flag types). LaunchDarkly lets you mark any flag as temporary or permanent (LaunchDarkly: creating flags).

Which pattern should I use?

1. Plan as an attribute in the flag tool. Your app sends the customer's plan with each evaluation, and a flag rule turns the feature on for the right plans. This is simple and works with any flag tool, but the plan mapping now lives in two places: billing and the flag rules.

2. A dedicated entitlements system. Billing or an entitlements service decides access, and your code asks it. Plans, limits and usage stay together, and pricing changes don't need flag edits.

3. Both, each for its job. Entitlements decide whether a customer may use a feature; a release flag decides whether the feature is ready for them yet. A feature is shown only when both say yes.

A common end state is pattern 3: entitlements for what's paid, flags for what's released.

How do I gate a feature by plan with a flag?

Send the plan as part of the evaluation context and write a rule on it. This uses OpenFeature with flagd reading a local file, so it runs without a server (@openfeature/server-sdk 1.23, @openfeature/flagd-provider 0.18):

{
  "$schema": "https://flagd.dev/schema/v0/flags.json",
  "flags": {
    "advanced-export": {
      "state": "ENABLED",
      "variants": { "on": true, "off": false },
      "defaultVariant": "off",
      "targeting": {
        "if": [{ "in": [{ "var": "plan" }, ["business", "enterprise"]] }, "on", "off"]
      }
    }
  }
}
import { OpenFeature } from '@openfeature/server-sdk'
import { FlagdProvider } from '@openfeature/flagd-provider'

await OpenFeature.setProviderAndWait(
  new FlagdProvider({ resolverType: 'in-process', offlineFlagSourcePath: './flags.json' }),
)
const client = OpenFeature.getClient()

for (const plan of ['free', 'pro', 'business']) {
  console.log(plan, await client.getBooleanValue('advanced-export', false, { targetingKey: 'acct-42', plan }))
}
// free false, pro false, business true

Read plan from your own database or billing system on each request, not from anything the browser sends. The code default is false, so evaluation errors, such as a missing flag or a provider that isn't ready, return closed; catch provider start-up failures yourself, because setProviderAndWait throws if the flag source can't be loaded.

Two cautions for this pattern:

  • Fail closed cuts both ways. If the flag tool is the gate for paid features, an outage or a bad rule locks paying customers out. For core paid features, check the plan from your own database rather than the flag.
  • Plan keys must match exactly. "Business" or "business-trial" don't match "business" in the rule above, so normalize plan keys (Stripe lookup_keys work well) and cover trials and custom contracts. Rules evaluated in the browser also expose your plan lists.

How do I combine entitlements and a release flag?

Check both on the server. The entitlement comes from your billing data; the flag controls the rollout:

async function canUseAdvancedExport(account) {
  const entitled = account.entitlements.includes('advanced_export') // from billing, stored in your database
  if (!entitled) return false
  return client.getBooleanValue('advanced-export-release', false, { targetingKey: account.id })
}

This lets you release a new paid feature to 10% of eligible customers, keep a kill switch for it, and still never show it to customers who haven't paid.

What do the tools offer?

From each vendor's documentation, read on 15 November 2026.

Tool Approach How access changes reach your app Usage limits
Stripe Entitlements Features attached to products; Stripe keeps an active entitlement per customer per feature Webhook entitlements.active_entitlement_summary.updated when a subscription changes, plus a list API to reconcile On/off features only; metering is a separate Stripe product
Stigg Plans bundle entitlements with limits; checked through an SDK or sidecar The Node.js SDK or the Sidecar keep a local cache (other SDKs call the API unless you run the Sidecar); Stigg cites under 10 ms for cached checks and real-time pushed updates Metering and credits
Schematic Plans, features and entitlements, synced with Stripe Flags evaluated against company data stored in Schematic Metering, limits and preflight checks
Reflag Flags gated by a company's plan attribute through segments Companies gain or lose access when their plan attribute changes Not native; compare a usage attribute
LaunchDarkly Flags targeted with segments (manual, synced or from SAML attributes), described in its entitlements guide Same as any flag Not native; compare a usage attribute
Unleash Permission flag type, permanent Same as any flag Not native; compare a usage attribute
Any flag tool Plan as a context attribute (pattern 1) Same as any flag Not native; compare a usage attribute

For flag tools, "compare a usage attribute" means a numeric rule on a value you send; metering the usage and enforcing the limit are still your job.

Sources: Stripe Entitlements, Stigg entitlements, caching and docs, Schematic flags and docs, Reflag feature entitlements, LaunchDarkly entitlements guide, Unleash flag types.

A few details worth knowing:

  • Stripe: product feature changes reach existing subscriptions at the start of their next billing period, and the webhook's summary lists at most 10 entitlements before you need to page through the full list. Stripe recommends storing entitlements in your own system. Entitlements are removed when a subscription is cancelled, including automatic cancellation after failed payments, so customers whose payments are past due keep access until then; decide your grace period on purpose. Webhooks can arrive late or out of order: each one carries the full summary, so keep the newest by its creation time or re-fetch from the list API, and verify signatures.
  • Schematic has a free Starter plan and a Growth plan at $400 a month, $320 billed yearly, with 10 million events and 20 company overrides a month (pricing). Prices change; check the page.

What goes wrong?

  • Gating only in the browser. A flag that hides a button doesn't protect the API behind it. Check entitlements on the server for every paid action.
  • Two sources of truth. If plans live in billing and also in flag rules, they drift: a customer downgrades and keeps access. Derive the flag's plan attribute from billing, or let entitlements decide access.
  • Stale plan data. If you cache the plan, update it on billing webhooks, such as Stripe's entitlement summary event, and on a schedule in case a webhook is missed.
  • Permanent flags piling up. Permission flags never expire, so they don't belong in the same clean-up process as release flags. Mark them permanent and review them separately (see stale feature flags).
  • Flag tool pricing. Depending on the pricing model, entitlement checks can count toward monthly active users or company billing for every customer, not just those in a rollout. Check feature flag pricing before routing every request through a flag.
  • Downgrades and seats. Decide what happens to data and seats above a lower plan's limit, and log denied checks so you notice customers who are locked out by mistake.

When should I add a dedicated entitlements system?

  • You have usage limits, such as seats, API calls or credits, not just on/off features.
  • Pricing changes often, or sales creates custom contracts and trials.
  • Several products or services need the same answer about what a customer owns.

Until then, pattern 1 with the plan read from your billing data is usually enough. For the difference between flags and configuration generally, see feature flags vs configuration vs environment variables; to pick a flag tool, see the best feature flag tools or the directory.