mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-09-16 12:58:26 -05:00
15 lines
326 B
TypeScript
15 lines
326 B
TypeScript
import { Stripe } from 'stripe';
|
|
import type { H3Event } from 'h3';
|
|
|
|
let stripe: Stripe | null = null;
|
|
|
|
export function useStripe(event: H3Event): Stripe | null {
|
|
if (!stripe) {
|
|
const config = useRuntimeConfig(event);
|
|
if (config.stripeSecretKey) {
|
|
stripe = new Stripe(config.stripeSecretKey);
|
|
}
|
|
}
|
|
return stripe;
|
|
}
|