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

@funnelsgrove/payments

v0.1.54

Published

Shared billing and checkout helpers for funnels.

Readme

@funnelsgrove/payments

Shared billing and checkout helpers for funnels.

Read this file before editing checkout code. Deeper implementation docs:

Owns provider-backed checkout primitives

@funnelsgrove/payments owns reusable payment contracts, provider adapters, checkout-session helpers, wallet slots, and checkout UI primitives. Funnel code owns paywall layout, copy, when an offer opens, post-payment navigation, and funnel-specific analytics timing.

Current Checkout Path

Use these for new subscription paywalls:

  • useStripeSubscriptionCheckoutSession
  • SharedStripeCheckoutV2Dialog
  • ApplePaySubscriptionCheckoutSlot
  • GooglePaySubscriptionCheckoutSlot
  • WalletSubscriptionCheckoutSlot
  • trackPaidStripeSubscriptionCheckoutCompleted

Use these for new one-time paywall plans:

  • createStripeOneTimeCheckout
  • SharedStripeCheckoutV2Dialog

Use chargeStripeOneClickPayment for post-checkout one-click upsells when the shared client helper fits the funnel. It delegates to funnelSdkService.chargeOneClickPayment.

Compatibility-Only Surfaces

Keep these exports available for saved drafts, old published artifacts, and controlled migrations. Do not use them for new subscription checkout work:

  • createStripePaymentIntent
  • SharedStripeCheckoutDialog
  • ApplePaySubscribeButton
  • GooglePaySubscribeButton
  • APPLE_PAY_QR_CODE_URL

When a live funnel still uses one of these, migrate the funnel deliberately with its own tests before removing the export.

Use This Package For

  • billing catalog types and normalization helpers
  • runtime-mode-aware plan catalog selection
  • Stripe SDK and public payment API client helpers
  • subscription checkout-session preparation, reuse, update, and recovery
  • reusable plan-selector UI
  • shared embedded checkout dialogs
  • Stripe Express Checkout wallet slots and lower-level wallet primitives
  • generic timed-offer display helpers
  • checkout completion analytics handoff to @funnelsgrove/analytics

Do Not Use This Package For

  • funnel routing
  • manifest validation
  • funnel-owned billing catalog entries
  • funnel-specific paywall layout or copy
  • funnel-specific decisions about when to activate, upgrade, or recover an offer
  • analytics transport internals
  • direct provider SDK calls inside funnel paywall steps; add provider adapters here first, then wire the funnel to the shared session or slot

Public Surfaces

  • config/billing.config: billing catalog, mapping, plan, and discount contracts.
  • services/planCatalog.service: plan resolution and selection helpers.
  • services/runtimeBillingPlanCatalog.service: test/live runtime catalog selection.
  • services/paywallOffer.service: timed discount and display-plan helpers.
  • services/stripe.service: Stripe loader, Checkout Session, hosted checkout, one-click, one-time Checkout Session clients, and deprecated PaymentIntent compatibility clients.
  • providers/*: provider-neutral checkout state and Stripe subscription checkout slots.
  • components/shared/*: plan selector, checkout dialogs, Express Checkout wrappers, wallet placeholders, and trust assets.
  • testing/walletCheckoutSmoke: wallet checkout smoke assertions.

Engineering Rules

  • Keep provider-specific implementation under src/providers/<provider>.
  • Stripe owns real card fields and wallet controls. Local wallet buttons are placeholders until Stripe confirms availability.
  • Wallet unavailable state must fall back to card/manual checkout or disappear.
  • Do not count checkout intent until the visitor taps or confirms a visible checkout CTA.
  • Wallet slots may create render-only Checkout Sessions on mount so Apple Pay and Google Pay render before the visitor taps. These sessions must use checkoutStartSource: 'wallet_render'; trusted server checkout_started analytics ignores that source.
  • Funnel paywalls should style wallet buttons through the shared slot API: className for the Stripe button/placeholder, slotClassName for the outer slot, appearance for Stripe Elements appearance, and options for Stripe Express Checkout options.
  • Keep discount math reusable here, but keep offer activation timing in funnel code.
  • Checkout metadata must avoid sensitive raw query params and use @funnelsgrove/analytics metadata helpers.

Build, Test, Publish

npm run test:run --workspace @funnelsgrove/payments
npm run build --workspace @funnelsgrove/payments
npm publish --workspace @funnelsgrove/payments --access public

The build normalizes generated relative ESM imports to explicit .js files for published package consumers.