@nodestackapp/plugin-stripe
v2.0.0
Published
Official Stripe payments, checkout sessions & webhooks plugin for NodeStack
Maintainers
Readme
@nodestackapp/plugin-stripe
Official Stripe payments, checkout sessions, customer billing, and webhook integration plugin for NodeStack.
Features
- Automated Collections: Auto-creates
_stripe_customersand_stripe_paymentssystem collections in SQLite. - Embedded Admin UI Dashboard: Dedicated Stripe billing view and overview cards directly in the NodeStack Admin UI.
- Stripe Checkout Sessions: Instant
POST /api/stripe/checkout-sessionendpoint to initiate checkout flows. - Webhook Processing: Secure
POST /api/stripe/webhookhandling and internalstripe:webhookEventBus broadcasting. - Zero Runtime Dependencies: Ultra-lightweight and compiled for dual CommonJS + ESM.
Installation
npm install @nodestackapp/plugin-stripe(Ensure @nodestackapp/server is installed as a peer dependency: npm install @nodestackapp/server)
Usage
import { NodeStack } from '@nodestackapp/server';
import { stripePlugin } from '@nodestackapp/plugin-stripe';
const app = new NodeStack();
app.use(stripePlugin({
secretKey: process.env.STRIPE_SECRET_KEY!,
currency: 'usd',
}));
// Listen to Stripe webhook events anywhere in your application
app.eventBus.on('stripe:webhook', async (event: any) => {
console.log('Stripe event received:', event.type);
});
await app.start(3000);Options
| Option | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| secretKey | string | (required) | Stripe secret key (sk_live_... or sk_test_...) |
| webhookSecret | string | undefined | Optional webhook endpoint signing secret |
| currency | string | 'usd' | Default currency ISO code |
| customersCollection | string | '_stripe_customers' | Custom collection name for customers |
| paymentsCollection | string | '_stripe_payments' | Custom collection name for payments |
License
MIT
