Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/billing/lib/stripe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import Stripe from 'stripe';
import { envs } from './envs.js';

export function getStripe() {
return new Stripe(envs.STRIPE_SECRET_KEY!, {
if (!envs.STRIPE_SECRET_KEY) {
throw new Error('STRIPE_SECRET_KEY is required to initialize Stripe');
}

return new Stripe(envs.STRIPE_SECRET_KEY, {
apiVersion: '2025-05-28.basil',
typescript: true,
telemetry: false
Expand Down
2 changes: 1 addition & 1 deletion packages/server/lib/controllers/v1/getEnvJs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const getEnvJs = asyncWrapper<any, any>((_, res) => {
publicPosthogKey: envs.PUBLIC_POSTHOG_KEY || '',
publicPosthogHost: envs.PUBLIC_POSTHOG_HOST || '',
publicLogoDevKey: envs.PUBLIC_LOGODEV_KEY || '',
publicStripeKey: envs.PUBLIC_STRIPE_KEY || '',
publicStripeKey: envs.PUBLIC_STRIPE_KEY || undefined,
isCloud,
isHosted,
isEnterprise,
Expand Down
2 changes: 1 addition & 1 deletion packages/types/lib/web/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface WindowEnv {
publicPosthogKey: string;
publicPosthogHost: string;
publicLogoDevKey: string;
publicStripeKey: string;
publicStripeKey: string | undefined;
isCloud: boolean;
isHosted: boolean;
isEnterprise: boolean;
Expand Down