Compare commits

...
Author SHA1 Message Date
Félix Malfait 2e574dac71 fix(website): use Stripe fetch client on Cloudflare Workers
The default Node http transport hangs on outbound TLS to api.stripe.com
under workerd (even with nodejs_compat) and aborts at the SDK's own 80s
timeout. Every /api/enterprise/* route is currently timing out in prod.
Switching to Stripe.createFetchHttpClient() uses workerd's native fetch.
2026-05-27 16:01:22 +02:00
@@ -10,7 +10,12 @@ export const getStripeClient = (): Stripe => {
throw new Error('STRIPE_SECRET_KEY is not configured');
}
stripeInstance = new Stripe(secretKey, {});
// On Cloudflare Workers the Stripe SDK's default Node http transport hangs
// on outbound TLS — even with nodejs_compat — and aborts at the SDK's own
// 80s timeout. Forcing the fetch-based client uses workerd's native fetch.
stripeInstance = new Stripe(secretKey, {
httpClient: Stripe.createFetchHttpClient(),
});
}
return stripeInstance;