Skip to content

The open alternative to Salesforce, designed for AI.

fix(website): use Stripe fetch client on Cloudflare Workers (#20966)

Félix Malfaite79f43813b89
diff --git a/packages/twenty-website/src/lib/enterprise/stripe-client.ts b/packages/twenty-website/src/lib/enterprise/stripe-client.ts
index 133801c30e1..03676a60590 100644
--- a/packages/twenty-website/src/lib/enterprise/stripe-client.ts
+++ b/packages/twenty-website/src/lib/enterprise/stripe-client.ts
@@ -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;