Skip to main content

Overview

useFetchManyEvents returns a callable that fetches a single page of events with all filters, sorting, geo, and free-text search. Visibility is enforced server-side. This is the low-level query — for a stateful list with sort state and load-more, use useFetchManyEventsWrapper.

Usage Example

Parameters

number
Page number (1-indexed). Defaults to 1.
number
Results per page. Capped at 100.
"startTime" | "going"
Sort field. Defaults to "startTime".
"asc" | "desc"
Sort direction. Left out, the sort’s natural direction: soonest first for "startTime", most going first for "going".
"upcoming" | "ongoing" | "past"
Derived time window.
string
ISO datetime lower bound on startTime.
string
ISO datetime upper bound on startTime.
string | "none" | null
Only this space’s events, or "none" for events not in any space. Left out or null: every event.
string
Only events this user hosts.
"online" | "physical" | "hybrid"
Filter by type.
"active" | "cancelled"
Defaults to "active".
RsvpStatus | RsvpStatus[]
Statuses the logged-in user RSVP’d with, e.g. ["going","maybe"].
{ latitude; longitude; radius }
Proximity filter (radius in meters).
{ hasTitle?; includes?; doesNotInclude? }
Free-text filter on title.
{ hasDescription?; includes?; doesNotInclude? }
Free-text filter on description.
EventIncludeParam
Associations to expand, as a single value or an array: "user", "space", "files", "userRsvp".

Returns

Returns a Promise<PaginatedResponse<Event>> — { data, pagination }.

See Also