@nyuro/products
v0.3.0
Published
Nyuro product catalog (amendment A4 §3): the four products, their display data and status, plans with Stripe price lookup keys and product ids, canonical limit keys, Flow plan features, and the catalog version entitlements are pinned to.
Readme
@nyuro/products
The static, versioned catalog of Nyuro's four products (amendment A4 §3,
docs/specs/AUTH-ENTITLEMENTS-AMENDMENT.md): display data and default status, plans with their
Stripe price lookup keys and Stripe product id, each product's canonical limit keys, Flow's plan
features, and CATALOG_VERSION.
import { catalog, resolvePrice, limitsFor, featuresFor } from '@nyuro/products'
resolvePrice({ lookupKey: price.lookup_key, productId: price.product }) // → { product, plan } | undefined
limitsFor('flow', row.plan, row.catalog_version, row.limits_override) // catalog[version] ⊕ override- Versions. An entitlement stores the catalog version its limits come from. Never edit the limits of a published version; add a new version and migrate customers deliberately.
- Unlimited is
-1(UNLIMITED), the value Flow already treats as "no cap". - Placeholders. In v1 every Stripe product id starts with
prod_PLACEHOLDER_and every lookup key withPLACEHOLDER_. The owner creates the real Stripe products and prices later and replaces them here (no new version needed: limits do not change). Until then no real Stripe price resolves.
