Skip to content

grahammccarthy/manage-stripe-customers

Repository files navigation

Stripe Customer Management App

This app allows you to manage Stripe customers efficiently. The primary feature is the ability to delete all customers from your Stripe account in bulk using a secure API.


Features

  • Bulk Customer Deletion: Delete all customers from your Stripe account with a single click.
  • Centralized Actions: Reusable server-side logic for Stripe interactions.
  • Modern Next.js Architecture: Built using Next.js 15 with app directory and React Server Components.
  • Secure API Routes: Stripe actions are protected and executed server-side.

Setup Instructions

1. Clone the Repository

git clone <repository-url>
cd <repository-name>

2. Install Dependencies

npm install

3. Set Up Environment Variables

Create a .env.local file in the root of the project with the following content:

STRIPE_SECRET_KEY=your-stripe-secret-key

Replace your-stripe-secret-key with your actual Stripe secret key from the Stripe Dashboard.

4. Run the Development Server

npm run dev

Visit http://localhost:3000 in your browser to access the app.


File Structure

/app
  /delete-customers
    page.tsx         # Page for deleting customers
  /api
    /delete-customers
      route.ts       # API route for deleting customers
/src
  /utils
    actions.ts       # Reusable server-side Stripe actions

Usage

Landing Page

  • The landing page at / introduces the app and its features.

Delete Customers Page

  1. Visit /delete-customers.
  2. Click the "Delete All Customers" button.
  3. The app will trigger a secure server-side action to delete all customers in your Stripe account.

Security Considerations

  • Authentication: Protect access to the app using an authentication mechanism.
  • Environment Checks: Ensure this app is only used in safe environments (e.g., development or staging).

Technologies Used


License

This project is open-source. Use it responsibly!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published