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, on the rows and the totals alike. The space’s active admins and moderators see every event in their space, invite events included; a host who isn’t an active member of the event’s space sees only what a regular viewer would. See Event visibility. 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: a whole number from 1 to 100. Defaults to 10. A larger value is rejected with 400 event/invalid-query, never lowered to 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 | Date
Lower bound on startTime: an ISO 8601 datetime in UTC, or a Date.
string | Date
Upper bound on startTime: an ISO 8601 datetime in UTC, or a Date.
string | "none"
Only this space’s events, or "none" for events not in any space. Left out: every event.
string
Only events this user hosts: events whose hostIds contain them, and events they own.
"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