npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

easy-stripe-checkout

v2.0.0

Published

A simplified Stripe checkout integration for React and Next.js applications

Readme

Easy Stripe Checkout

A simplified Stripe checkout integration for React and Next.js applications with extensive theme customization.

Features

  • 🔒 Simple Integration: Add Stripe checkout with minimal code
  • 🎨 Highly Customizable: Extensive theme system with pre-built themes
  • 📱 Responsive Design: Works on all devices
  • 🛒 Order Summary: Built-in display of cart items
  • Next.js Ready: Server components and API routes support
  • 💳 Multiple Payment Methods: Support for cards, Apple Pay, Google Pay, and more
  • 📊 TypeScript Support: Full type safety and IntelliSense

Installation

npm install easy-stripe-checkout
# or
yarn add easy-stripe-checkout

Quick Start

1. Create a payment intent API route

// app/api/create-payment-intent/route.ts
import { createPaymentIntentHandler } from 'easy-stripe-checkout';
import { NextResponse } from 'next/server';

const handler = createPaymentIntentHandler({
  secretKey: process.env.STRIPE_SECRET_KEY!,
});

export async function POST(request: Request) {
  return handler(request, NextResponse);
}

2. Add the Checkout component

'use client';

import { StripeCheckout } from 'easy-stripe-checkout';

const cartItems = [
  {
    id: '1',
    name: 'Premium Widget',
    price: 5100, // $51.00 in cents
    quantity: 1,
  },
  {
    id: '2',
    name: 'Basic Gadget',
    price: 2500, // $25.00 in cents
    quantity: 2,
  },
];

export default function CheckoutPage() {
  return (
    <StripeCheckout
      cartItems={cartItems}
      options={{
        successUrl: `${window.location.origin}/success`,
        cancelUrl: `${window.location.origin}/cancel`,
        currency: 'usd',
      }}
      stripePublicKey={process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!}
      theme={{
        colors: {
          primary: '#4f46e5', // Your brand color
        }
      }}
    />
  );
}

Theme Customization

Easy Stripe Checkout offers extensive theme customization options. You can use built-in themes or create your own:

// Using a built-in theme
<StripeCheckout
  // other props...
  theme={{
    theme: 'night', // 'stripe', 'night', or 'flat'
    colors: {
      primary: '#00d4ff', // Override primary color
    }
  }}
/>

// Using a custom theme
<StripeCheckout
  // other props...
  theme={{
    colors: {
      primary: '#6366f1',
      background: '#ffffff',
      text: '#111827',
      // ...other colors
    },
    fonts: {
      family: 'Inter, system-ui, sans-serif',
      // ...font settings
    },
    // ...other theme properties
  }}
/>

For more details, see the Theme Customization Guide.

Pre-built Themes

The package includes several pre-built themes you can use:

import { StripeCheckout, modernMinimalTheme } from 'easy-stripe-checkout';

<StripeCheckout
  // other props...
  theme={modernMinimalTheme}
/>

Available themes:

  • Standard: modernMinimalTheme, softUITheme, darkModeTheme, verticalTabsTheme, compactTheme, brandedTheme
  • Experimental: cyberpunkTheme, brutalistTheme, neumorphicTheme, glassmorphicTheme, retro80sTheme, and more

API Reference

StripeCheckout Props

| Prop | Type | Description | |------|------|-------------| | cartItems | CartItem[] | Array of items in the cart | | options | CheckoutOptions | Checkout options (success/cancel URLs, currency) | | stripePublicKey | string | Your Stripe publishable key | | theme | ThemeOptions | Theme customization options | | onPaymentSuccess | (paymentId: string) => void | Success callback | | onPaymentError | (error: any) => void | Error callback |

CartItem Interface

interface CartItem {
  id: string;
  name: string;
  description?: string;
  price: number; // In cents
  quantity: number;
  image?: string; // Optional URL
}

CheckoutOptions Interface

interface CheckoutOptions {
  successUrl: string;
  cancelUrl: string;
  currency?: string; // Default: 'usd'
}

Examples

See the /examples directory for complete implementations.

Browser Support

Easy Stripe Checkout works in all modern browsers. Internet Explorer is not supported.

License

MIT