diff options
| author | Frank <[email protected]> | 2026-02-22 18:41:34 -0500 |
|---|---|---|
| committer | Frank <[email protected]> | 2026-02-22 22:19:44 -0500 |
| commit | 5712cff5c453a185ac75a160f76ca06135d6ab2d (patch) | |
| tree | 6838fedd40aed31421265fdc8b9fe5826d396f86 /infra/console.ts | |
| parent | ee754c46f992dd4024e56e93246421246d16d13f (diff) | |
| download | opencode-5712cff5c453a185ac75a160f76ca06135d6ab2d.tar.gz opencode-5712cff5c453a185ac75a160f76ca06135d6ab2d.zip | |
zen: track session in usage
Diffstat (limited to 'infra/console.ts')
| -rw-r--r-- | infra/console.ts | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/infra/console.ts b/infra/console.ts index 3f3c2b8d9..283fe2c37 100644 --- a/infra/console.ts +++ b/infra/console.ts @@ -100,26 +100,46 @@ export const stripeWebhook = new stripe.WebhookEndpoint("StripeWebhookEndpoint", ], }) -const zenProduct = new stripe.Product("ZenBlack", { +const zenLiteProduct = new stripe.Product("ZenLite", { + name: "OpenCode Lite", +}) +const zenLitePrice = new stripe.Price("ZenLitePrice", { + product: zenLiteProduct.id, + currency: "usd", + recurring: { + interval: "month", + intervalCount: 1, + }, + unitAmount: 1000, +}) +const ZEN_LITE_PRICE = new sst.Linkable("ZEN_LITE_PRICE", { + properties: { + product: zenLiteProduct.id, + price: zenLitePrice.id, + }, +}) +const ZEN_LITE_LIMITS = new sst.Secret("ZEN_LITE_LIMITS") + +const zenBlackProduct = new stripe.Product("ZenBlack", { name: "OpenCode Black", }) -const zenPriceProps = { - product: zenProduct.id, +const zenBlackPriceProps = { + product: zenBlackProduct.id, currency: "usd", recurring: { interval: "month", intervalCount: 1, }, } -const zenPrice200 = new stripe.Price("ZenBlackPrice", { ...zenPriceProps, unitAmount: 20000 }) -const zenPrice100 = new stripe.Price("ZenBlack100Price", { ...zenPriceProps, unitAmount: 10000 }) -const zenPrice20 = new stripe.Price("ZenBlack20Price", { ...zenPriceProps, unitAmount: 2000 }) +const zenBlackPrice200 = new stripe.Price("ZenBlackPrice", { ...zenBlackPriceProps, unitAmount: 20000 }) +const zenBlackPrice100 = new stripe.Price("ZenBlack100Price", { ...zenBlackPriceProps, unitAmount: 10000 }) +const zenBlackPrice20 = new stripe.Price("ZenBlack20Price", { ...zenBlackPriceProps, unitAmount: 2000 }) const ZEN_BLACK_PRICE = new sst.Linkable("ZEN_BLACK_PRICE", { properties: { - product: zenProduct.id, - plan200: zenPrice200.id, - plan100: zenPrice100.id, - plan20: zenPrice20.id, + product: zenBlackProduct.id, + plan200: zenBlackPrice200.id, + plan100: zenBlackPrice100.id, + plan20: zenBlackPrice20.id, }, }) const ZEN_BLACK_LIMITS = new sst.Secret("ZEN_BLACK_LIMITS") @@ -196,6 +216,8 @@ new sst.cloudflare.x.SolidStart("Console", { AWS_SES_SECRET_ACCESS_KEY, ZEN_BLACK_PRICE, ZEN_BLACK_LIMITS, + ZEN_LITE_PRICE, + ZEN_LITE_LIMITS, new sst.Secret("ZEN_SESSION_SECRET"), ...ZEN_MODELS, ...($dev |
