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

@parsrun/payments

v0.1.33

Published

Edge-compatible payment processing for Pars - Stripe, Paddle, iyzico

Downloads

1,705

Readme

@parsrun/payments

Edge-compatible payment processing for Pars with subscription and billing support.

Features

  • Multi-Provider: Stripe, Paddle, iyzico
  • Subscriptions: Full subscription lifecycle management
  • Usage Billing: Metered billing support
  • Webhooks: Secure webhook handling
  • Dunning: Failed payment recovery

Installation

pnpm add @parsrun/payments

Quick Start

import { createPaymentService } from '@parsrun/payments';

const payments = createPaymentService({
  provider: 'stripe',
  secretKey: process.env.STRIPE_SECRET_KEY,
  webhookSecret: process.env.STRIPE_WEBHOOK_SECRET,
});

// Create checkout session
const session = await payments.createCheckout({
  customerId: 'cus_xxx',
  priceId: 'price_xxx',
  successUrl: 'https://example.com/success',
  cancelUrl: 'https://example.com/cancel',
});

API Overview

Providers

Stripe

import { createStripeProvider } from '@parsrun/payments/providers/stripe';

const stripe = createStripeProvider({
  secretKey: process.env.STRIPE_SECRET_KEY,
  webhookSecret: process.env.STRIPE_WEBHOOK_SECRET,
});

Paddle

import { createPaddleProvider } from '@parsrun/payments/providers/paddle';

const paddle = createPaddleProvider({
  vendorId: process.env.PADDLE_VENDOR_ID,
  apiKey: process.env.PADDLE_API_KEY,
});

iyzico

import { createIyzicoProvider } from '@parsrun/payments/providers/iyzico';

const iyzico = createIyzicoProvider({
  apiKey: process.env.IYZICO_API_KEY,
  secretKey: process.env.IYZICO_SECRET_KEY,
  sandbox: true,
});

Subscriptions

// Create subscription
const subscription = await payments.createSubscription({
  customerId: 'cus_xxx',
  priceId: 'price_xxx',
  trialDays: 14,
});

// Cancel subscription
await payments.cancelSubscription(subscriptionId, {
  cancelAtPeriodEnd: true,
});

// Update subscription
await payments.updateSubscription(subscriptionId, {
  priceId: 'price_new',
});

Billing

import { createBillingManager } from '@parsrun/payments/billing';

const billing = createBillingManager({
  provider: stripeProvider,
  database: db,
});

// Get customer billing info
const info = await billing.getCustomerBilling(customerId);

// Create invoice
const invoice = await billing.createInvoice({
  customerId,
  items: [{ description: 'Service', amount: 1000 }],
});

Usage Billing

import { createUsageTracker } from '@parsrun/payments/usage';

const usage = createUsageTracker({
  provider: stripeProvider,
});

// Record usage
await usage.record({
  subscriptionId: 'sub_xxx',
  quantity: 100,
  timestamp: new Date(),
});

Webhooks

import { createWebhookHandler } from '@parsrun/payments/webhooks';

const webhooks = createWebhookHandler({
  provider: stripeProvider,
  handlers: {
    'checkout.session.completed': async (event) => {
      // Handle successful checkout
    },
    'invoice.payment_failed': async (event) => {
      // Handle failed payment
    },
  },
});

app.post('/webhooks/stripe', webhooks.handle);

Dunning (Payment Recovery)

import { createDunningManager } from '@parsrun/payments/dunning';

const dunning = createDunningManager({
  provider: stripeProvider,
  retrySchedule: [1, 3, 7, 14], // Days
  onFinalFailure: async (subscription) => {
    // Handle subscription cancellation
  },
});

Exports

import { ... } from '@parsrun/payments';                 // Main exports
import { ... } from '@parsrun/payments/providers/stripe';  // Stripe
import { ... } from '@parsrun/payments/providers/paddle';  // Paddle
import { ... } from '@parsrun/payments/providers/iyzico';  // iyzico
import { ... } from '@parsrun/payments/billing';           // Billing
import { ... } from '@parsrun/payments/usage';             // Usage billing
import { ... } from '@parsrun/payments/webhooks';          // Webhooks
import { ... } from '@parsrun/payments/dunning';           // Dunning

License

MIT