moved page rendering to a different service and access is now behind
admin.DOMAIN www.DOMAIN db.DOMAIN
This commit is contained in:
parent
c7f6b30b87
commit
1027da989e
126 changed files with 6356 additions and 1516 deletions
15
app-public/src/lib/stripe-client.ts
Normal file
15
app-public/src/lib/stripe-client.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue