getpaykit/paykit

Build Stripe billing without the glue code. Products in code, webhooks handled, billing state in your app.

TypeScript

1,061

953 commits

updated Sep 27, 2026

See the code

README


PayKit

Build Stripe billing without the glue code

Define plans in code. Gate features. Track usage. Webhooks handled for you.

Website · Docs · Discord · Twitter

npm version License npm downloads


What is PayKit?

PayKit is an embedded Stripe billing framework for TypeScript apps. It runs inside your app, uses your database, and gives you a typed API for products, subscriptions, entitlements, and usage billing without stitching together raw Stripe APIs and webhooks.

import { createPayKit, feature, plan } from "paykitjs";

const messages = feature({ id: "messages", type: "metered" });

const free = plan({
  id: "free",
  group: "base",
  default: true,
  includes: [messages({ limit: 100, reset: "month" })],
});

const pro = plan({
  id: "pro",
  group: "base",
  price: { amount: 19, interval: "month" },
  includes: [messages({ limit: 2_000, reset: "month" })],
});

export const paykit = createPayKit({
  stripe: {
    secretKey: process.env.STRIPE_SECRET_KEY!,
    webhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
  },
  database: process.env.DATABASE_URL!,
  products: [free, pro],
});

Getting started

npx paykitjs init

Or follow the installation guide.

Why PayKit

Billing in the TypeScript ecosystem is either handled through low-level provider SDKs that require a lot of glue code, or through hosted platforms that own your billing data and sit between you and your customers. PayKit takes a different approach: it's an open-source framework that runs inside your app, keeps billing state in your own database, and handles the Stripe lifecycle so you don't have to.

Contribution

PayKit is a free and open-source project licensed under the MIT License.

You can help continue its development by:

Security

If you discover a security vulnerability within PayKit, please send an email to security@paykit.sh.

All reports will be promptly addressed, and you'll be credited accordingly.

Sponsors

PayKit is supported by companies and individuals who help keep the project maintained. Want to support PayKit? Become a sponsor →

PayKit sponsors

billing
fintech
paykit
payments
pricing
saas
sdk
stripe
typescript

getpaykit/paykit

Build Stripe billing without the glue code. Products in code, webhooks handled, billing state in your app.

TypeScript

1,061

953 commits

updated Sep 27, 2026

See the code

README


PayKit

Build Stripe billing without the glue code

Define plans in code. Gate features. Track usage. Webhooks handled for you.

Website · Docs · Discord · Twitter

npm version License npm downloads


What is PayKit?

PayKit is an embedded Stripe billing framework for TypeScript apps. It runs inside your app, uses your database, and gives you a typed API for products, subscriptions, entitlements, and usage billing without stitching together raw Stripe APIs and webhooks.

import { createPayKit, feature, plan } from "paykitjs";

const messages = feature({ id: "messages", type: "metered" });

const free = plan({
  id: "free",
  group: "base",
  default: true,
  includes: [messages({ limit: 100, reset: "month" })],
});

const pro = plan({
  id: "pro",
  group: "base",
  price: { amount: 19, interval: "month" },
  includes: [messages({ limit: 2_000, reset: "month" })],
});

export const paykit = createPayKit({
  stripe: {
    secretKey: process.env.STRIPE_SECRET_KEY!,
    webhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
  },
  database: process.env.DATABASE_URL!,
  products: [free, pro],
});

Getting started

npx paykitjs init

Or follow the installation guide.

Why PayKit

Billing in the TypeScript ecosystem is either handled through low-level provider SDKs that require a lot of glue code, or through hosted platforms that own your billing data and sit between you and your customers. PayKit takes a different approach: it's an open-source framework that runs inside your app, keeps billing state in your own database, and handles the Stripe lifecycle so you don't have to.

Contribution

PayKit is a free and open-source project licensed under the MIT License.

You can help continue its development by:

Security

If you discover a security vulnerability within PayKit, please send an email to security@paykit.sh.

All reports will be promptly addressed, and you'll be credited accordingly.

Sponsors

PayKit is supported by companies and individuals who help keep the project maintained. Want to support PayKit? Become a sponsor →

PayKit sponsors

billing
fintech
paykit
payments
pricing
saas
sdk
stripe
typescript

Project health

Latest release

0.1.0 · Mar 3, 2026

Releases this year

1

Significant stargazers

Alex Yang

6,375 followers · starred Mar 2026

Sora Morimoto

959 followers · starred May 2026

Boris Dayma

3,240 followers · starred Apr 2026

wong2

2,526 followers · starred Apr 2026