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!")
},
},
})Plugins, webhooks, and type-safe entitlements. Everything you need to bill Ethiopian users.
Extend BirrJS with plugins. Integrate SMS providers, email services, or custom logic — all through a simple plugin interface.
Full TypeScript inference from your plan schema. Plan IDs, feature keys — all typed.
Feature flags based on subscription status. Check entitlements instantly with check().
Verified, deduplicated webhook handling. Automatically sync to your database.
All billing state in your Postgres. Low latency, joinable with your app tables.
Built-in support for Chapa, Arifpay, Santimpay — and any provider via the provider interface.
Define your plans, connect Chapa, and ship billing in minutes.
Get Started