The billing framework
for TypeScript
Define plans and features in code. PayKit handles Stripe, webhooks, and usage state - runs inside your app.
import { feature, plan } from "paykitjs"
const messages = feature({ id: "msgs", type: "metered" })
const proModels = feature({ id: "pros", type: "boolean" })
export const free = plan({
id: "free",
default: true,
includes: [
messages({ limit: 20, reset: "month" }),
],
})
export const pro = plan({
id: "pro",
price: { amount: 19, interval: "month" },
includes: [
messages({ limit: 100, reset: "month" }),
proModels(),
],
})import { createPayKit } from "paykitjs"
import { free, pro } from "./products"
export const paykit = createPayKit({
database: env.DATABASE_URL,
stripe: {
secretKey: env.STRIPE_SECRET_KEY,
webhookSecret: env.STRIPE_WEBHOOK_SECRET,
},
products: [free, pro],
on: {
"subscription.activated": async ({ customer }) => {
await sendEmail(customer.email, "Welcome to Pro!")
},
}
})How it works
localhost:3000
Free
AI ChatFree$0
2 msg/moPro$19/mo
10 msg/mo2/2
Backend
Interact with the app to see
what happens behind the scenes
what happens behind the scenes
Feedback

Guillermo Rauch
@rauchg👀

Gruz
@damnGruzsick!!! will try it

jordi
@jordienrpaykit looks very interesting, like a really good abstraction without lock in

Andrew Qu
@andrewquPaykit and opensec are too good

Matteo Scotto
@442utopythat looks amazing! Congrats for the launch

Jonathan Wilke
@jonathan_wilkeHonestly, this is probably the best lib project I have come across since better-auth.

Lasse
@lassejvHoly shit paykit by @maxktz is really good.

lakshmi
@simhskalvery cool

Leo
@leodevYou should check it out, really cool billing framework

Creem 🍦
@creem_ioLooks amazing Max! 🙌

jan
@miaugladiator1just saw paykit and it looks actually soooo cool have to try this out asap

Saïd Aitmbarek
@SaidAitmbarekGotta try this one, brilliant work mate.
Ready to add billing?
One command to get started. Define your plans, connect Stripe, and ship billing in minutes.