API Reference
API Reference
REST endpoints for the Hono + Bun API server running on port 3002.
The API server (apps/api) is built with Hono + Bun.
Base URL
| Environment | URL |
|---|---|
| Local | http://localhost:3002 |
| Production | https://api.your-domain.com |
Endpoints
GET /health
Health check — used by uptime monitors and load balancers.
Response: 200 OK, body: OK
curl http://localhost:3002/health
# OKGET /cron/keep-alive
Keeps the database connection warm. Triggered by a cron scheduler.
Response: 200 OK
{ "ok": true }curl http://localhost:3002/cron/keep-alive
# {"ok":true}POST /webhooks/payments
Receives Stripe webhook events.
Requires a valid stripe-signature header. Run bun run stripe in apps/api to forward events locally via the Stripe CLI.
Headers:
| Header | Required | Description |
|---|---|---|
stripe-signature | Yes | Stripe webhook signature |
Handled events:
| Event | Action |
|---|---|
checkout.session.completed | Fires "User Subscribed" analytics event |
subscription_schedule.canceled | Fires "User Unsubscribed" analytics event |
Response: 200 OK
{ "result": { "type": "checkout.session.completed", ... }, "ok": true }POST /webhooks/auth
Auth webhook endpoint for external integrations.
Body: Any JSON payload
Response: 200 OK
{ "success": true }Running Locally
cd apps/api
bun run devWith Stripe webhook forwarding:
bun run stripe