NextStripe
Simplified server-side Stripe workflows in Next.js
⚠️ PLEASE NOTE: This library is currently in beta and should be used in production with caution!
Getting Started
yarn add next-stripe@beta
Add the API route
Create a [...nextstripe].js catch-all route in your project's pages/api/stripe directory.
⚠️ PLEASE NOTE: It is recommended you use a restricted key with limited API access with this library. These keys can be created and configured with the required access in the Stripe Dashboard.
import NextStripe from 'next-stripe'
export default NextStripe({
stripe_key: process.env.STRIPE_RESTRICTED_KEY
})