first commit
This commit is contained in:
10
lib/stripe-client.ts
Normal file
10
lib/stripe-client.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { loadStripe, Stripe } from '@stripe/stripe-js';
|
||||
|
||||
let stripePromise: Promise<Stripe | null>;
|
||||
|
||||
export const getStripe = () => {
|
||||
if (!stripePromise) {
|
||||
stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);
|
||||
}
|
||||
return stripePromise;
|
||||
};
|
||||
Reference in New Issue
Block a user