moved shared code to the shared package

This commit is contained in:
Jakub Dorfman 2026-08-19 19:18:10 +02:00
parent 1027da989e
commit 478a5fd466
46 changed files with 43 additions and 5959 deletions

View file

@ -1,15 +1 @@
import { loadStripe as _loadStripe } from '@stripe/stripe-js';
import { env } from '$env/dynamic/public';
import { browser } from '$app/environment';
let stripePromise: ReturnType<typeof _loadStripe> | null = null;
export function loadStripe() {
if (!browser) return null;
if (!stripePromise) {
const key = env.PUBLIC_STRIPE_PUBLISHABLE_KEY;
if (!key) throw new Error('PUBLIC_STRIPE_PUBLISHABLE_KEY is not set');
stripePromise = _loadStripe(key);
}
return stripePromise;
}
export * from '$shared/stripe-client';