Define plans and features in code. BirrJS handles subscriptions, webhooks, and entitlements — with usage tracking, all inside your codebase.
$ npx @birrjs/cli initimport { feature, plan } from "birrjs"
const messages = feature({ id: "msgs", type: "metered" })
const proAccess = 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: 499, interval: "month" },
includes: [
messages({ limit: 100, reset: "month" }),
proAccess(),
],
})import { chapa } from "@birrjs/chapa"
import { createBirrJS } from "birrjs"
import { free, pro } from "./plans"
export const birr = createBirrJS({
provider: chapa({
secretKey: env.CHAPA_SECRET_KEY,
webhookSecret: env.CHAPA_WEBHOOK_SECRET,
callbackUrl: process.env.CALLBACK_URL
}),
database: env.DATABASE_URL,
plans: [free, pro],
on: {
"subscription.activated": ({ customer, plan }) => {
await sendEmail(customer.email, "Welcome to Pro!")
},
},
})BirrJS speaks a single provider interface. Start on Chapa, swap to Telebirr later, or route manual transfers through links.et or verify.et — your billing code never changes.
One command scaffolds your provider, plans, and config — real files you can open, edit, and deploy.
Plugins, webhooks, and type-safe entitlements. Everything you need to bill Ethiopian users.
Extend BirrJS with plugins. Drop in SMS, email, Slack, trials, or custom logic — all through one simple plugin interface.
Built-in support for Chapa, Telebirr, Links.et, and Verify.et — or bring any provider via the provider interface.
Full TypeScript inference from your plan schema. Plan IDs, feature keys — all typed.
Verified, deduplicated webhook handling. Automatically sync to your database.
Feature flags based on subscription status. Check instantly with check().
All billing state in your Postgres. Low latency, joinable with your app tables.
npx @birrjs/cli init scaffolds your provider, plans, config, and route handler — billing ready in under a minute.
Define your plans, connect Chapa, and ship billing in minutes.
Get Started