EN

@core / stripe

1.0.0 ▾
verifiedMIT
GitHub

Shared Stripe client and one idempotent, signature-verified webhook endpoint dispatching events to every module

Code8 filesContext~545 tokensMCP stripescan passed

The exact tree that will be injected, after .genpmignore. Pinned to

src/lib/stripe/client.tsread-only · 43dfe91
// Cliente de Stripe perezoso desde STRIPE_SECRET_KEY. `setStripe` permite inyectar otro en tests.
import Stripe from 'stripe';

let current: Stripe | null = null;

export function getStripe(): Stripe {
  if (!current) {
    const key = process.env.STRIPE_SECRET_KEY;
    if (!key) throw new Error('STRIPE_SECRET_KEY is not set (see .env.example)');
    current = new Stripe(key);
  }
  return current;
}

export function setStripe(stripe: Stripe): void {
  current = stripe;
}

export { Stripe };

Report @core/stripe

Sign in with GitHub to report a package.