From 76f0d1dabe45150b340bcd880faf6f8b3301e942 Mon Sep 17 00:00:00 2001 From: Grant Date: Sun, 10 May 2026 07:59:00 -0500 Subject: [PATCH] EntitlementsCatalog field in PublicPoliciesProduct (parity with TS / Rust / Python 0.3.0) Mirrors keysat 0014 + the v0.3.0 cuts of the other three SDKs. New EntitlementDef type with Slug + Name + Description; PublicPoliciesProduct gains EntitlementsCatalog []EntitlementDef. SDK consumers' in-app tier pickers can render display names + tooltip descriptions instead of raw slugs. Empty slice on legacy products without a catalog. No breaking change. --- online.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/online.go b/online.go index afbd204..fd10dd5 100644 --- a/online.go +++ b/online.go @@ -247,13 +247,25 @@ type PublicPolicy struct { TrialDays int64 `json:"trial_days"` } +// EntitlementDef is one entry in a product's entitlements catalog +// (Keysat migration 0014). Operator declares the closed list once per +// product; policies pick from this list. Use Name as the human-readable +// label when rendering an in-app tier picker (e.g. "AI summaries" +// instead of the raw "ai_summaries" slug). +type EntitlementDef struct { + Slug string `json:"slug"` + Name string `json:"name"` + Description string `json:"description"` +} + // PublicPoliciesProduct is the product-level fields on the public // policies response. type PublicPoliciesProduct struct { - Slug string `json:"slug"` - Name string `json:"name"` - Description string `json:"description"` - BasePriceSats int64 `json:"base_price_sats"` + Slug string `json:"slug"` + Name string `json:"name"` + Description string `json:"description"` + BasePriceSats int64 `json:"base_price_sats"` + EntitlementsCatalog []EntitlementDef `json:"entitlements_catalog"` } // PublicPoliciesResponse is the response from GET /v1/products//policies.