Openstatus www.openstatus.dev
at main 14 lines 353 B view raw
1import type { Stripe as StripeProps } from "@stripe/stripe-js"; 2import { loadStripe } from "@stripe/stripe-js"; 3 4import { env } from "@/env"; 5 6let stripePromise: Promise<StripeProps | null>; 7 8export const getStripe = () => { 9 if (!stripePromise) { 10 stripePromise = loadStripe(env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY); 11 } 12 13 return stripePromise; 14};