useListEvents hook provides access to individual event records with pagination.
It fetches data from the /events/list endpoint, allowing you to display detailed event logs and histories.
Parameters
The feature ID or array of feature IDs to query events for.
Number of events to skip for pagination. Defaults to 0.
Maximum number of events to return per page. Defaults to 50.
Custom date range for filtering events by timestamp.
Optional SWR configuration object to customize caching and revalidation behavior. Accepts a
refreshInterval in milliseconds.Returns
list
Array of individual event records. Each event object includes:
id: Unique event identifiertimestamp: Unix timestamp in milliseconds when the event occurredfeature_id: The feature associated with the event recordedcustomer_id: The customer that recorded this eventvalue: The numeric value recorded with the eventproperties: Metadata and custom properties for the event
hasMore
Boolean indicating whether there are more events available on subsequent pages.
hasPrevious
Boolean indicating whether there are previous events available on earlier pages.
page
Current page number (1-based indexing).
isLoading
Boolean indicating whether the event data is currently being fetched.
error
Any AutumnError that occurred while fetching event data.
refetch()
Function to manually refetch the current page of events.
nextPage()
Function to navigate to the next page of events. Only call when hasMore is true.
prevPage()
Function to navigate to the previous page of events. Only call when hasPrevious is true.

