summaryrefslogtreecommitdiff
path: root/apps/web/lib/stripe.ts
blob: 1955c0243ade1bd2a6217597822e36a5cc62c026 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
import Stripe from "stripe"

let stripeInstance: Stripe | null = null

export function getStripe(): Stripe {
  if (!stripeInstance) {
    stripeInstance = new Stripe(process.env.STRIPE_SECRET_KEY!)
  }

  return stripeInstance
}