jaza.consume() from your backend after a billable action succeeds. Pass a dashboard featureCode (or raw credits) and an idempotency key so retries never double-charge.
Prerequisites
- Features configured in the dashboard
- A customer with a wallet (
cus_…) @jazadev/nodewithsecretKey+publicKey
Call consume
credits instead of featureCode when you need an explicit debit amount.
Charge after success
Prefer deducting after the feature succeeds so failed work is not billed:Errors
The Node SDK throwsJazaError with statusCode, code, and raw. Handle insufficient balance by prompting a top-up (Top up). See Errors for the envelope shape.