PREMIUM ADD-ON ✨Real-time wallet alerts are part of the real-time usage add-on, available on Lago Cloud upon request only. Please contact us to enable it for your organization.
alert.triggered webhook reaches you from under a second to a few seconds after the event that crossed the threshold.
What changes
It applies to wallet alerts. Usage alerts keep their periodic check. Nothing changes in how you create alerts or consume webhooks. The add-on changes when alerts fire, not what they are.
Use cases
Cut access on time
Block or downgrade a customer when credits run out, not a minute after they went into debt.
Top up before the stop
Trigger a top-up or a payment request on a low-balance threshold while the customer is still running.
Catch spikes early
A token or compute surge drains a wallet fast. A low-balance alert catches it while it is still small, so you can throttle or notify.
How it works
1
An event arrives
You send usage events as usual. Lago aggregates them as they stream in.
2
The balance refreshes
The wallet’s ongoing balance reflects the event within seconds.
3
Alerts are evaluated
Lago checks your wallet alerts against the new balance. A burst of events triggers one alert, not one per event.
4
Your product acts
You receive
alert.triggered and decide what happens: warn, throttle, block or top up.Set up a real-time wallet alert
Once the add-on is enabled, create alerts exactly as you would without it. Give each threshold acode that maps to the action your product takes.
Create a low-credits alert
alert.triggered, with the same payload as any other alert: warn on warning, restrict on critical, block or top up on empty. To also know when a value is back on the safe side, use alert resolution.
Good to know
- Lago notifies, your product enforces. Blocking, throttling or topping up happens in your application or gateway.
- Not a spending cap. Usage served before your product reacts is still consumed, and a balance can go below zero. To enforce a hard limit, authorize the work in your application before it starts.
- Automatic fallback. If the real-time path is delayed, alerts are evaluated on the periodic cycle. No threshold crossing is lost.
- Coverage follows real-time usage. A wallet’s balance refreshes in real time only for charges covered by the add-on. Usage from other charges reaches the balance, and its alerts, on the periodic cycle.