EntitlementsFeature
Source:
src/Stripe/EntitlementsFeature.ts
A Stripe Entitlements Feature — a monetizable ability you attach to
Products. When a customer purchases a product with this feature, Stripe
creates an entitlement for them. lookup_key is unique among active
features and immutable (changing it replaces the feature). Name and
metadata update in place.
Stripe does not hard-delete features; destroying this resource
deactivates it (active: false). Archived features cannot be edited
or unarchived. An archived lookup key can be reused — a later create
with the same key provisions a new feature.
Creating a Feature
Section titled “Creating a Feature”Generated lookup key
const seats = yield* Stripe.EntitlementsFeature("seats");Named feature with lookup key
const seats = yield* Stripe.EntitlementsFeature("seats", { lookupKey: "seats", name: "Seat licenses",});Updating a Feature
Section titled “Updating a Feature”const seats = yield* Stripe.EntitlementsFeature("seats", { lookupKey: "seats", name: "Seat licenses (updated)", metadata: { plan: "pro" },});Deactivating a Feature
Section titled “Deactivating a Feature”// stack.destroy() / resource removal sets active: falseconst seats = yield* Stripe.EntitlementsFeature("seats", { lookupKey: "seats", name: "Seat licenses",});