create-moneta
v0.0.2
Published
Scaffold a MonetaKit project — pricing & subscriptions as code. `npm create moneta <dir>` and pick a target (worker | …).
Maintainers
Readme
create-moneta
Scaffold a MonetaKit project — pricing & subscriptions as code.
npm create moneta my-billing
# or pick a target explicitly:
npm create moneta my-billing -- --template workerTargets
| --template | What you get |
| --- | --- |
| worker | The self-managed recurring engine on Cloudflare Workers (Cron + D1 + @monetakit/engine): a Cron Trigger charges due subscriptions off-session; an HTTP handler registers subscriptions and ingests Stripe webhooks. Run subscriptions on a pure gateway and skip Stripe Billing's fee. |
More targets (app — SDK integration; self-host — the planfiled daemon + Postgres)
land behind the same entry point.
After scaffolding
cd my-billing && npm install
npx wrangler d1 create my-billing # paste the id into wrangler.jsonc
npm run migrate # create the tables
npx wrangler secret put STRIPE_API_KEY
npm run deployThe worker template is the same code as
examples/workers-engine (a test keeps them in
sync), verified end-to-end against a live Cloudflare Worker + D1 + Stripe.
