JSPM

  • Created
  • Published
  • Downloads 725
  • Score
    100M100P100Q115276F
  • License MIT

Provider-agnostic payment infrastructure for NestJS with support for Stripe, Paddle, LemonSqueezy, and Mollie.

Package Exports

  • @breadstone/archipel-platform-payments
  • @breadstone/archipel-platform-payments/lemonsqueezy
  • @breadstone/archipel-platform-payments/lemonsqueezy/index
  • @breadstone/archipel-platform-payments/mollie
  • @breadstone/archipel-platform-payments/mollie/index
  • @breadstone/archipel-platform-payments/package.json
  • @breadstone/archipel-platform-payments/paddle
  • @breadstone/archipel-platform-payments/paddle/index
  • @breadstone/archipel-platform-payments/stripe
  • @breadstone/archipel-platform-payments/stripe/index

Readme

@breadstone/archipel-platform-payments

Provider-agnostic payment infrastructure for NestJS with support for Stripe, Paddle, LemonSqueezy, and Mollie.

⚠️ Environment Variables (Most Important)

Choose one provider and configure its required variables.

Stripe

Variable Required Default Description
STRIPE_API_KEY yes - Stripe secret API key
STRIPE_WEBHOOK_SECRET yes - Stripe webhook signing secret

Paddle

Variable Required Default Description
PADDLE_API_KEY yes - Paddle API key
PADDLE_WEBHOOK_SECRET yes - Paddle webhook secret key
PADDLE_ENVIRONMENT no production Paddle environment (production or sandbox)

LemonSqueezy

Variable Required Default Description
LEMONSQUEEZY_API_KEY yes - LemonSqueezy API key
LEMONSQUEEZY_WEBHOOK_SECRET yes - LemonSqueezy webhook signing secret
LEMONSQUEEZY_STORE_ID yes - LemonSqueezy store ID

Mollie

Variable Required Default Description
MOLLIE_API_KEY yes - Mollie API key
MOLLIE_WEBHOOK_SECRET no - Mollie webhook secret for verification

Import Options

import { PaymentModule } from '@breadstone/archipel-platform-payments';

Provider-specific imports:

import { StripeClient, STRIPE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-payments/stripe';
import { PaddleClient, PADDLE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-payments/paddle';
import { LemonSqueezyClient, LEMONSQUEEZY_CONFIG_ENTRIES } from '@breadstone/archipel-platform-payments/lemonsqueezy';
import { MollieClient, MOLLIE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-payments/mollie';

Quick Start

import { PaymentModule } from '@breadstone/archipel-platform-payments';
import { StripeClient, STRIPE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-payments/stripe';

@Module({
  imports: [
    PaymentModule.register({
      paymentClient: StripeClient,
      configEntries: STRIPE_CONFIG_ENTRIES,
    }),
  ],
})
export class AppModule {}

Features

  • Provider-agnostic: Switch between Stripe, Paddle, LemonSqueezy, or Mollie without changing business logic
  • Subpath imports: Each provider lives in its own subpath — install only the SDK you need
  • Normalized types: All providers return the same INormalizedPrice, INormalizedSubscription, etc.
  • Feature gating: FeatureGuard + @RequiresFeature() for quota-based access control
  • Usage tracking: FeatureUsageInterceptor records feature consumption automatically

Available Providers

Subpath Class SDK
@breadstone/archipel-platform-payments/stripe StripeClient stripe
@breadstone/archipel-platform-payments/paddle PaddleClient @paddle/paddle-node-sdk
@breadstone/archipel-platform-payments/lemonsqueezy LemonSqueezyClient @lemonsqueezy/lemonsqueezy.js
@breadstone/archipel-platform-payments/mollie MollieClient @mollie/api-client

Development

# Build
yarn nx build platform-payments

# Test
yarn nx test platform-payments

# Lint
yarn nx lint platform-payments