← nopea.tech
ScaneaConsenteaMaskeaBundlesPricing
Budgeting & cost

Separate budgets for staging vs production

budget() tracks spend from .maskea/budget.jsonl in the current working directory -- run staging and prod as separate processes/deployments and each gets its own independent cap.

← All recipes
import { Maskea, budget } from "@nopeatech/maskea";

const isProd = process.env.NODE_ENV === "production";

const maskea = new Maskea().use(
  budget({ maxMonthlyUsd: isProd ? 500 : 20 })
);

// Each environment's .maskea/ directory is independent -- staging
// hitting its (much lower) cap never affects production's budget.

Checked against the shipped @nopeatech/maskea API. Full docs at nopea.tech/maskea/docs.

More in Budgeting & cost

Handle a budget cap without crashing →