mirror of
https://github.com/fergalmoran/supanextail.git
synced 2026-01-04 15:44:12 +00:00
User can subscribe and it will be effective in the database. We now need to reflect this on the front end. Issue : Need to check how to upgrade a current subscription
15 lines
332 B
JavaScript
15 lines
332 B
JavaScript
/**
|
|
* This is a singleton to ensure we only instantiate Stripe once.
|
|
*/
|
|
import { loadStripe } from "@stripe/stripe-js";
|
|
|
|
let stripePromise = null;
|
|
const getStripe = () => {
|
|
if (!stripePromise) {
|
|
stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY);
|
|
}
|
|
return stripePromise;
|
|
};
|
|
|
|
export default getStripe;
|