@llamafarm/corral
v0.5.0
Published
Authentication, billing, and API scaffolding for SaaS apps — batteries included
Readme
🦙 @llamafarm/corral
Auth, billing, and API scaffolding for SaaS apps — batteries included.
What it does
@llamafarm/corral is the server-side core of the Corral SaaS toolkit. Drop it into any Hono app to get:
- 🔐 Authentication — email/password, OAuth, magic links via better-auth
- 💳 Billing — Stripe subscriptions, usage-based metering, webhooks, and portal links
- 🗄️ Database adapters — SQLite, PostgreSQL, MySQL
- 🔒 API gating — plan-aware route protection with
corralGate() - 📊 Usage tracking — increment counters, enforce limits, expose usage APIs
Install
npm install @llamafarm/corralQuick Setup
import { Hono } from 'hono';
import { corral } from '@llamafarm/corral';
const app = new Hono();
app.use('/api/*', corral({
auth: {
secret: process.env.BETTER_AUTH_SECRET!,
database: { provider: 'sqlite', url: './corral.db' },
},
stripe: {
secretKey: process.env.STRIPE_SECRET_KEY!,
webhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
},
}));
export default app;Exports
| Export | Description |
|--------|-------------|
| @llamafarm/corral | Server middleware, auth, billing, gating |
| @llamafarm/corral/client | Browser-safe client utilities |
Docs
📖 Full documentation at llama-farm.github.io/corral
License
MIT © llama-farm
