Description
This module provides a clean, actively maintained Stripe wrapper integration for Nuxt, supporting both server-side and client-side usage via composables (useServerStripe(event) and useClientStripe()). I need it myself, as the original used fixed stripe package version, and I needed newer stripe api versions.
It was originally forked from the now-archived @unlok-co/nuxt-stripe (by flozero), where I contributed before it got archived too. I made some distinct changes to the original:
- Stripe packages are now peer dependencies: no duplicate instances, no constant update churn in the module itself. It only required Stripe versions (
stripe >= 17, @stripe/stripe-js >= 5)
@stripe/stripe-js is fully optional: only required for client-side UI features
- Full TypeScript support with re-exported types (
ServerStripe, Stripe, StripeElements, etc.)
- Nuxt 3 and 4 compatible (minimum
3.1.0)
- Runtime config support with automatic env var pickup (
NUXT_STRIPE_SECRET_KEY, NUXT_PUBLIC_STRIPE_PUBLISHABLE_KEY): I renamed the variables to make it as clear as possible, which key can be public and which is meant for server side work
- Manual client load mode (
manualClientLoad: true) for lazy initialization (already in the original repo)
- Real Tests, Built with
@nuxt/module-builder, tested with @nuxt/test-utils and Vitest: I am not the best at writing test, I would welcome here some guidance, but I think I pretty much covered the most cases.
For all features and how-tos, I welcome you to read the README.md: https://github.com/Shooteger/nuxt-stripe/blob/main/README.md
Repository
https://github.com/Shooteger/nuxt-stripe
npm
https://www.npmjs.com/package/@shooteger/nuxt-stripe
Nuxt Compatibility
Nuxt 3, Nuxt 4
Description
This module provides a clean, actively maintained Stripe wrapper integration for Nuxt, supporting both server-side and client-side usage via composables (
useServerStripe(event)anduseClientStripe()). I need it myself, as the original used fixed stripe package version, and I needed newer stripe api versions.It was originally forked from the now-archived
@unlok-co/nuxt-stripe(by flozero), where I contributed before it got archived too. I made some distinct changes to the original:stripe >= 17,@stripe/stripe-js >= 5)@stripe/stripe-jsis fully optional: only required for client-side UI featuresServerStripe,Stripe,StripeElements, etc.)3.1.0)NUXT_STRIPE_SECRET_KEY,NUXT_PUBLIC_STRIPE_PUBLISHABLE_KEY): I renamed the variables to make it as clear as possible, which key can be public and which is meant for server side workmanualClientLoad: true) for lazy initialization (already in the original repo)@nuxt/module-builder, tested with@nuxt/test-utilsand Vitest: I am not the best at writing test, I would welcome here some guidance, but I think I pretty much covered the most cases.For all features and how-tos, I welcome you to read the README.md: https://github.com/Shooteger/nuxt-stripe/blob/main/README.md
Repository
https://github.com/Shooteger/nuxt-stripe
npm
https://www.npmjs.com/package/@shooteger/nuxt-stripe
Nuxt Compatibility
Nuxt 3, Nuxt 4