This repository shows you how to use Node (version 8+) and Stripe to create recurring subscriptions with built-in SCA support. It is an updated version of stripe-recurring-subscriptions.
It uses Express for creating a simple server, Nunjucks for templating, and the Stripe API.
We’ve written 2 detailed tutorials about this code on the 🌟 CodeNebula blog:
🌟How to Set up a Basic Node Application with Stripe
🌟How to use Stripe’s new Payment Intents API with Node.js to create subscriptions with built-in SCA
- Clone this repository
- Run
npm installto install all dependencies - Create a
.envfile to house your Stripe Secret Key (this repo includes.envin its.gitignore) - In the
.envfile, set your secret key as STRIPE_API_KEY (STRIPE_API_KEY="sk_test_************************") - In the Javascript section of the
views/register.htmlfile, replacevar stripe = Stripe("pk_test_************************")with your Stripe Publishable Key - Run the app via
npm run start - Navigate to localhost:3000







