This is a React version of the HTML + Vanilla JavaScript client implementation. It works with any of the backends in the server
folder.
- Enable client-only checkout: https://dashboard.stripe.com/account/checkout/settings
- Create a one-time or recurring product in the Stripe Dashboard: https://dashboard.stripe.com/products
- After creation click the "Use with checkout" button and copy the price (sku_xxx) ID.
- Set up the environment variables for React
cp .env.example .env
In the newly created .env
file, set the values:
- Set the price ID that you created in the Dashboard for
REACT_APP_PRICE_ID
- Copy your publishable key from: https://dashboard.stripe.com/apikeys and set it as the value for
REACT_APP_STRIPE_PUBLISHABLE_KEY
- Set
REACT_APP_BASE_PRICE
andREACT_APP_CURRENCY
to match your sku details from the Dashboard
- Install the dependecies
npm install
- Start the React client
npm start
- Client running on http://localhost:3000
- Author: @thorsten-stripe
- This project was bootstrapped with Create React App.