https://github.com/getpaykit/paykit
The billing framework for TypeScript. Code-first products, handles Stripe, webhooks, and usage state, runs in your app.
https://github.com/getpaykit/paykit
billing creem fintech paykit payments polar pricing saas sdk stripe typescript
Last synced: about 1 month ago
JSON representation
The billing framework for TypeScript. Code-first products, handles Stripe, webhooks, and usage state, runs in your app.
- Host: GitHub
- URL: https://github.com/getpaykit/paykit
- Owner: getpaykit
- License: mit
- Created: 2026-02-08T23:16:43.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-04-27T21:16:04.000Z (about 2 months ago)
- Last Synced: 2026-04-27T21:25:35.508Z (about 2 months ago)
- Topics: billing, creem, fintech, paykit, payments, polar, pricing, saas, sdk, stripe, typescript
- Language: TypeScript
- Homepage: https://paykit.sh
- Size: 17.2 MB
- Stars: 875
- Watchers: 5
- Forks: 32
- Open Issues: 56
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
The billing framework for TypeScript
Define products in code. Any provider. Gate features. Track usage.
Website ·
Docs ·
Discord ·
Twitter
---
## What is PayKit?
PayKit is an embedded billing framework for TypeScript apps. It sits inside your app, uses your database, and gives you a single API to manage products, subscriptions, entitlements, and usage billing without touching provider dashboards.
```ts
import { stripe } from "@paykitjs/stripe";
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({
provider: stripe({
secretKey: process.env.STRIPE_SECRET_KEY!,
webhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
}),
database: process.env.DATABASE_URL!,
products: [free, pro],
});
```
### Getting started
```bash
npx paykitjs init
```
Or follow the [installation guide](https://paykit.sh/docs/get-started/installation).
### 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](./LICENSE). You are free to do whatever you want with it.
You can help continue its development by:
- [Contribute to the source code](./CONTRIBUTING.md)
- [Suggest new features and report issues](https://github.com/getpaykit/paykit/issues)
## Security
If you discover a security vulnerability within PayKit, please send an email to [security@paykit.sh](mailto:security@paykit.sh).
All reports will be promptly addressed, and you'll be credited accordingly.