ProductFeature
Source:
src/Stripe/ProductFeature.ts
A Stripe Product Feature — the attachment of an Entitlements Feature
to a Product. When a customer purchases a product that has a feature
attached, Stripe creates an entitlement to that feature. Existence-only:
there is nothing to update in place; changing product or
entitlementFeature replaces the attachment. Destroy deletes it.
Product features have no metadata of their own. Ownership for
account-wide list() (nuke) is inferred from the parent Product’s
Alchemy metadata.
Attaching a Feature
Section titled “Attaching a Feature”const product = yield* Stripe.Product("pro-plan", { name: "Pro Plan" });const analytics = yield* Stripe.EntitlementsFeature("analytics", { lookupKey: "analytics", name: "Analytics",});const attachment = yield* Stripe.ProductFeature("pro-analytics", { product: product.id, entitlementFeature: analytics.id,});Replacing an Attachment
Section titled “Replacing an Attachment”const reporting = yield* Stripe.EntitlementsFeature("reporting", { lookupKey: "reporting", name: "Reporting",});const attachment = yield* Stripe.ProductFeature("pro-analytics", { product: product.id, entitlementFeature: reporting.id,});