Skip to main content

Interface: CreditManagerOptions

Defined in: javascript/src/manager.ts:106

Optional behavioural knobs for the manager.

Properties

defaultTtlSeconds?

optional defaultTtlSeconds?: number

Defined in: javascript/src/manager.ts:125

Default lease TTL (seconds) for reserve/runBilled (default 600).


lazyExpiry?

optional lazyExpiry?: boolean

Defined in: javascript/src/manager.ts:137

Enable lazy-on-read credit expiry (default false, unchanged behaviour).

Allowance windows and lease TTLs are already lazy-on-read (checked via expiresAt/window filters at read time); credit expiry otherwise requires an explicit sweepExpiredCredits call (e.g. from a cron job). When true, the manager transparently sweeps a user's own expired credits (scoped to that user — never a global sweep) before getBalance, getCreditTiers, deduct, deductFixed, deductTeam, reserve, and settle so a caller never needs to run a cron job.


lowBalance?

optional lowBalance?: LowBalanceConfig | null

Defined in: javascript/src/manager.ts:123

credits.low_balance thresholds and handler (interface plan §6). When omitted, the manager uses [engine.minBalance * 2] (documented default, M18), resolved lazily. The event is edge-triggered: each configured level fires only on the deduction that crosses it from above, never repeatedly while already below it, and re-arms on top-up.


maxConcurrent?

optional maxConcurrent?: number | null

Defined in: javascript/src/manager.ts:115

Default maxConcurrent lease bound applied by the preset.


overdraftFloor?

optional overdraftFloor?: number | Decimal | null

Defined in: javascript/src/manager.ts:113

Negative balance floor for the overdraft preset (interface plan §1).


policy?

optional policy?: PolicyPreset

Defined in: javascript/src/manager.ts:111

Financial-safety preset for planless users (interface plan §2). Defaults to "strict_prepaid". Per-plan / per-call policy layers on top of this.