useUsageEvents hook lists usage events for a single feature using your backend route.
By default it calls GET /api/priceos/v1/usage-events and requests the current period.
- Typed
- Untyped
Parameters
Feature key to list events for (typed to your tracked limit feature keys when using generated types).
Enable or disable fetching. Defaults to
true.Usage period to query. Defaults to
"current".
Ignored when customRange is provided.Optional custom Unix-ms range.
start and end are required when provided.Page size. Defaults to
20. Allowed range is 1 to 1000.Optional SWR Infinite config for pagination/revalidation behavior.
Returns
Flattened list of fetched usage events.
Whether the first page is loading.
Whether
getMore() is currently loading the next page.Whether more events are available.
Total event count for the current query.
Error from the latest request.
Loads the next page when available.
Revalidates loaded pages.