Subscription billing for Ethiopian apps.
BirrJS
Ethiopian payment billing and subscription management for TypeScript
Documentation
·
GitHub
·
Issues
## Quick Start
```bash
npx @birrjs/cli init
```
Or set up manually:
```ts
import { createBirr, feature, plan } from "@birrjs/core";
import { chapa } from "@birrjs/chapa";
const messages = feature({ id: "messages", type: "metered" });
const free = plan({
id: "free",
name: "Free",
default: true,
includes: [messages({ limit: 100, reset: "month" })],
});
const pro = plan({
id: "pro",
name: "Pro",
price: { amount: 29, interval: "monthly" },
includes: [messages({ limit: 5000, reset: "month" })],
});
const birr = createBirr({
database: process.env.DATABASE_URL!,
provider: chapa({
secretKey: process.env.CHAPA_SECRET_KEY!,
webhookSecret: process.env.CHAPA_WEBHOOK_SECRET!,
callbackUrl: process.env.CALLBACK_URL!,
returnUrl: process.env.RETURN_URL!,
}),
plans: [free, pro],
identify: async (request) => {
const session = await auth.api.getSession({ headers: request.headers });
if (!session) return null;
return { customerId: session.user.id, email: session.user.email };
},
});
```
## Documentation
Full docs at birrjs.dev.
## License
MIT