From 3ebcc94349f18b00e30adfd2d85ad73a11ea2301 Mon Sep 17 00:00:00 2001 From: Timo Knuth Date: Mon, 6 Jul 2026 12:37:33 +0200 Subject: [PATCH] feat(server): free tier with 3 monthly credits Co-Authored-By: Claude Fable 5 --- server/lib/billing.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/lib/billing.js b/server/lib/billing.js index 8d13518..9558d99 100644 --- a/server/lib/billing.js +++ b/server/lib/billing.js @@ -1,6 +1,6 @@ const { get, run } = require('./postgres'); -const FREE_MONTHLY_CREDITS = 0; +const FREE_MONTHLY_CREDITS = 3; const TRIAL_MONTHLY_CREDITS = 30; const PRO_MONTHLY_CREDITS = 100; const TOPUP_DEFAULT_CREDITS = 100; @@ -255,7 +255,6 @@ const getOrCreateAccount = async (db, userId) => { }; const getAvailableCredits = (account) => { - if (account.plan !== 'pro') return 0; const monthlyRemaining = Math.max(0, account.monthlyAllowance - account.usedThisCycle); return monthlyRemaining + Math.max(0, account.topupBalance); }; @@ -570,9 +569,6 @@ const syncRevenueCatWebhookEvent = async (db, eventPayload) => { const consumeCredits = (account, cost) => { if (cost <= 0) return 0; - if (account.plan !== 'pro') { - throw createInsufficientCreditsError(cost, 0); - } const available = getAvailableCredits(account); if (available < cost) {