Stripe Elements is inherently browser code, so it cannot run in Node.js. StripeKit ships an optional companion frontend module you serve alongside your Node.js backend, and it never touches your server process.Import from the @ricardoneudorfer/stripekit/elements entry point only on the pages that need it.
A clientSecret is returned by kit.payments.create() or kit.checkout.create() whenever the resolved flow is elements, either because mode was set to 'elements' on init, or because mode: 'both' was configured and 'elements' was passed per call. See Choosing a mode.