feat: storage and token limiting

This commit is contained in:
Vasily Zubarev
2025-04-21 13:50:45 +02:00
parent 62bad46e58
commit 73e83221b8
25 changed files with 232 additions and 65 deletions

13
lib/stripe.ts Normal file
View File

@@ -0,0 +1,13 @@
import Stripe from "stripe"
import config from "./config"
export const stripeClient: Stripe | null = config.stripe.secretKey
? new Stripe(config.stripe.secretKey, {
apiVersion: "2025-03-31.basil",
})
: null
// Type guard to check if Stripe is initialized
export const isStripeEnabled = (client: Stripe | null): client is Stripe => {
return client !== null
}