#yebuntu

1 messages · Page 1 of 1 (latest)

stuck patioBOT
obtuse wharf
latent acorn
#

Em, sure sec

#

On the client side

  <Elements stripe={getStripe()} options={{ clientSecret: activeClientSecret }}>
                      <StripePurchase product={product} />
                    </Elements>
import { Stripe, loadStripe } from '@stripe/stripe-js';

let stripePromise: Promise<Stripe | null>;
const getStripe = () => {
  if (!stripePromise) {
    stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY);
  }
  return stripePromise;
};

export default getStripe;
obtuse wharf