Skip to main content
A Feature Flag benefit is an entitlement your application checks. Polar grants it when a customer buys a product that includes it and revokes it when access ends. Your code decides what the flag unlocks. Use it to gate premium features, give beta access, or set plan limits through metadata, without checking product IDs in your code.

What the customer gets

Access to whatever your application unlocks for the flag. Polar delivers nothing on its own, and the flag is hidden from the customer by default.

Create it

A feature flag has no properties. Configure it through metadata, which your application reads back with the grant.
  • Open Catalog → Benefits
  • Click Create Benefit
  • Choose Feature Flag as the Type
  • Set the Description, e.g. “Pro features”
  • Optionally click Add Metadata and add keys such as tier → pro
  • Click Create
Then attach it to a product. See Manage benefits.

Options

properties is always an empty object.

Check access in your application

Read the customer’s granted_benefits from the customer state by your own user ID. Match on the benefit’s id, or read benefit_metadata for its configuration. These examples use API version 2026-10.
From your terminal: polar customers get_state_external user_123, or ask your agent “Does user_123 have the Pro features benefit in my Polar sandbox organization?” (the customers_get_state_external operation). Don’t call the API on every request. Cache the result and refresh it when the customer.state_changed webhook arrives. Its payload is the same customer state. See Sync customer state.

Customer experience

Nothing changes for the customer in Polar. Hidden by default, the flag doesn’t appear at checkout, in emails or in the Customer Portal. They see the feature in your application.

Revocation

  • Subscriptions: granted while the subscription is active or trialing, including after the customer cancels, until the period ends. Revoked when the subscription ends.
  • One-time purchases: granted for good, unless you revoke it when refunding the order.
On revocation, the grant disappears from granted_benefits and Polar sends customer.state_changed.

Visibility

Configurable, and hidden (private) by default. Set it to Visible if you want the flag’s description listed on the product and in the Customer Portal. Hidden flags are still in the customer state.

Learn more