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

@seifer-webapp-factory/billing

v0.1.1

Published

billing — zesde capability-module: verticale, pluggable full-stack betaal-feature (eenmalige checkout + abonnementen) via Mollie hosted checkout, die de kits samenbindt via één contract. Componeert de jobs-kit (webhook-idempotentie + reconciliatie-schedul

Readme

@seifer-webapp-factory/billing

The billing capability module — a vertical, full-stack payments feature: one-time checkout and recurring subscriptions via Mollie hosted checkout, with invoices and an immutable audit trail. It composes the foundation kits behind one front↔back contract, and it is the sixth capability module (after authentication, authorization, account, media, user-settings).

  • Design doc / decisions (verified against primary sources): ../billing.md
  • Tier model: ../README.md
  • Manifest spec: @seifer-webapp-factory/capability-spec (this module's manifest.ts is a facade over it)

What it is

| Part | Contents | |---|---| | contract/ | the seam: endpoints, DTOs (zod), error taxonomy, events, config schema — both halves generate types from it | | backend/src | mechanism (pinned dependency): framework-free flow services + the PaymentProvider port; the 3-path webhook reconciliation | | backend/templates | surface (materialized, project-owned): NestJS controller/module, migrations, pg BillingStore, the Mollie adapter, config, security | | frontend/src | mechanism: the typed client + Vue composables (usePlans / useCheckout / useSubscriptions / usePayments / useInvoices) | | frontend/templates | surface: plans.vue / checkout.vue / subscriptions.vue / invoices.vue / return.vue (folded-in payment-module-*), i18n, runtime | | manifest.ts | provides / requires (+modules: ['authentication']) / config / migrations / contract / templateVersion | | scaffolder/ | version-aware materializer + the module→module presence-check | | tests/ | contract, backend unit, Mollie-adapter, frontend component, scaffolder, and (infra-gated) backend e2e |

Requires

  • Module dependency: authentication (a billing customer is always a subject; ownership is keyed on the subject id). The scaffolder refuses to assemble billing if authentication is absent (checkRequiredModules).
  • Kits: backend jobs, audit-log, persistence, http-kernel, config, mailer, observability, i18n, rate-limit; frontend payment, forms, http-client, data, notifications, auth.
  • Requires-ports (host provides): PaymentProvider (Mollie adapter ships in the surface), SubjectProvider, Mailer, Database, DesignSystem.

Install (backend)

import { BillingModule } from '@seifer-webapp-factory/billing/backend/templates/nestjs/billing.module.js';

BillingModule.forRoot({
  pool,                         // persistence-kit pool
  subjectProvider,              // from the authentication module (bearer → subject)
  config: {
    mollieApiKey: process.env.MOLLIE_API_KEY,   // config-kit Secret — never logged
    webhookUrl: 'https://your.app/billing/webhook',
    returnUrl:  'https://your.app/billing/return',
    plans: [{ id: 'pro', name: 'Pro', amountMinor: 999, currency: 'EUR', interval: '1 month' }],
  },
  // provider: fakeProvider(),  // override the PSP in tests; default is the Mollie adapter from config
});

Run the migrations (billing_customers, billing_payments, billing_plans, billing_subscriptions, billing_invoices, billing_webhook_events + the invoice sequence) via the persistence-kit runner (billingMigrations).

Config (divergence level 1)

provider (mollie) · mollieApiKey (Secret, required) · profileId · webhookUrl + returnUrl (required) · defaultCurrency (EUR) · plans (id · name · amountMinor · currency · interval · trialDays) · maxOneTimeAmountMinor · dunning (notify-only: notifyOnFailure + graceWindowDays) · invoiceNumberPrefix.

Divergence & eject

  1. Configure — the knobs above (plans, currency, dunning window).
  2. Extend — add a payment method; hook a billing.payment.succeeded handler; add a plan field.
  3. Materialize & edit — eject checkout.vue / the invoice surface, or the Mollie adapter itself, and edit freely; the mechanism keeps upgrading via semver.
  4. Fork — replace the PaymentProvider mechanism / embed card fields (knowingly enters PCI SAQ-D).

Design invariants (verified against primary sources — see ../billing.md)

  • No card data — Mollie hosted redirect only; the host stays in PCI-DSS SAQ-A.
  • Webhook trusts only the id — the server re-fetches authoritative status from Mollie; a spoofed body cannot mark an unpaid order paid. Idempotent on provider_ref + status.
  • Money is integer minor units + ISO-4217; the Mollie adapter converts currency-aware (EUR/JPY/BHD).
  • Recurrence is delegated to Mollie mandates + subscriptions; dunning is notify-only (Mollie owns the retry ladder — the module never issues its own retry charge). Plan changes update the subscription in-place (no proration in v1).