Documentation
Overview
A native, opt-in subscription backend for Stackhouse that mirrors RevenueCat's core server surface.
Stackhouse-Billing (RevenueCat-style Subscriptions)
Stackhouse-Billing is a native, opt-in subscription backend for Stackhouse that mirrors RevenueCat's core server surface: apps, products, entitlements, offerings, customers, subscriptions, and lifecycle webhooks. It integrates Apple App Store, Google Play, and Stripe receipts/events out of the box.
Architecture
Rendering diagram…
Enabling
Set the environment variable STACKHOUSE_ENABLE_BILLING=1 before starting
stackhouse. When enabled, the module:
- runs idempotent migrations on boot (tables prefixed
billing_) - mounts its router at
/v1/billing - spawns a background outbound-webhook dispatcher
Optional environment fallbacks (overridable per-app via the admin API):
| Variable | Purpose |
|---|---|
STACKHOUSE_BILLING_APPLE_SHARED_SECRET | Apple verifyReceipt shared secret |
STACKHOUSE_BILLING_STRIPE_SIGNING_SECRET | Stripe webhook signing secret |
STACKHOUSE_BILLING_GOOGLE_ACCESS_TOKEN | Service-account OAuth token (androidpublisher scope) |
What's in this section
- Data Model — tables and entity relationships
- REST API — admin, customer, and public routes
- Webhooks — inbound store notifications and outbound delivery
- Entitlements & Security — resolution logic and security caveats
- Experiments & Paywalls — A/B tests, audiences, and paywall editor
- Frontend SDKs — JS/TS SDK, React bindings, and the embedded admin UI
Next: Data Model