events module covers the full events surface: creating and editing events, the RSVP lifecycle, host and invite management, and the guest list. It maps directly to the Events API.
Because the Node SDK authenticates with a service key (it acts as the whole project, not a single end user), most write functions take an explicit userId naming the user the action is performed as. For host- and invite-management functions, userId is instead the target user (the host/invitee), and the action is authorized as the project.
Image upload caveat. The Node SDK does not support inline cover/gallery
upload on
createEvent/updateEvent yet. Create the event first, then attach
images with sublay.storage.uploadImage using its
eventId parameter. (The browser JS SDK and the
React SDK do support inline upload.)events bundle. Space-scoping needs the spaces bundle; images need files-images; notifications need notifications.
createEvent
Creates an event. TheuserId you pass becomes the creator and is auto-added to hostIds. Returns the event with inline rsvpCounts.
Event title. 1–300 characters.
ISO datetime when the event starts.
Event format.
online requires url; physical requires address or location; hybrid requires both.The user to create the event as (creator + first host). With a service key this may be any user.
Optional description.
Optional ISO end datetime.
Optional IANA timezone.
Join/stream URL.
Venue name.
Street address.
Coordinates for proximity search.
Scope the event to a space. Required when
visibility is "members".Defaults to
"public".Max
going RSVPs. Omit for unlimited.Allow
"maybe" RSVPs. Defaults to true.Expose the named guest list to non-hosts. Defaults to
true.Additional host user IDs (the creator is always added).
Arbitrary key-value data. Up to 1 MB.
Promise<Event>
fetchEvent
Fetches a single event by ID. PassuserId to resolve visibility for that user and to populate userRsvp (with the userRsvp include).
The event ID.
Comma-separated associations:
"user", "space", "files", "userRsvp".The requester id, for visibility resolution and
userRsvp enrichment.Promise<Event>
fetchManyEvents
Lists events with visibility enforced, plus filtering, sorting, geo, and free-text search. PassuserId to resolve member/invite/host visibility and to use the myRsvp filter.
Page number (1-indexed). Defaults to
1.Results per page. Capped at
100.Sort field. Defaults to
"startTime".Sort direction. Defaults to
"asc".Derived time window.
ISO datetime lower bound on
startTime.ISO datetime upper bound on
startTime.Restrict to one space.
Only events this user hosts.
Filter by type.
Defaults to
"active".Comma-separated statuses the requester RSVP’d with, e.g.
"going,maybe". Requires userId.Proximity filter (radius in meters).
Free-text filter on
title.Free-text filter on
description.Comma-separated associations.
The requester id (visibility +
myRsvp + userRsvp).Promise<PaginatedResponse<Event>>
updateEvent
Edits an event’s mutable fields. Host-only at the API level; with a service key the call is authorized as the project.hostIds, status, and spaceId are not editable here.
The event ID.
New title.
New description.
New ISO start datetime.
New ISO end datetime.
New timezone.
New type (re-validates location fields).
New URL.
New venue name.
New address.
New coordinates.
New visibility.
New capacity.
Allow
"maybe" RSVPs.Expose the guest list.
New metadata.
Promise<Event>
cancelEvent
Cancels an event (setsstatus: "cancelled"). The event stays fetchable but rejects new RSVPs.
The event ID.
Promise<Event>
deleteEvent
Permanently (or soft-, per the project’seventDeletion settings) deletes an event and cleans up its RSVPs and invites.
The event ID.
Promise<void>
setRsvp
Sets or changes a user’s RSVP. Transitions intogoing are capacity-checked.
The event ID.
The RSVP response.
The user to RSVP as. With a service key this may be any user.
Promise<Event> (with refreshed rsvpCounts)
withdrawRsvp
Removes a user’s RSVP. Idempotent.The event ID.
The user to withdraw. With a service key this may be any user.
Promise<Event>
addHost
Grants a user host privileges. TheuserId is the target host; the action is authorized as the project.
The event ID.
The user to grant host on the event.
Promise<Event>
removeHost
Revokes a user’s host privileges. Rejected if it would leave the event with no hosts.The event ID.
The host to remove.
Promise<Event>
addInvite
Invites a user to the event. Idempotent. TheuserId is the target invitee.
The event ID.
The user to invite (userId only — never a foreign ID).
Promise<Event>
removeInvite
Removes a user’s invite, revoking their access and dropping their RSVP.The event ID.
The invitee to remove.
Promise<Event>
fetchInvitees
Host-only invitee (guest) list. Returns paginated EventInvite records with the invited user populated.The event ID.
Page number (1-indexed).
Results per page. Capped at
100.Promise<PaginatedResponse<EventInvite>>
fetchEventRsvps
Named RSVP (guest) list. Returns paginated EventRsvp records with the user populated. Visible to hosts always, to any viewer whenguestListVisible is true, or to service keys. RSVP counts themselves are public via the event’s rsvpCounts.
The event ID.
Comma-separated statuses to filter by, e.g.
"going,maybe". Omit for all.Page number (1-indexed).
Results per page. Capped at
100.Promise<PaginatedResponse<EventRsvp>>
Attaching images
Create the event, then upload a cover or gallery image and associate it witheventId:
Uploading via
storage.uploadImage attaches a gallery image (a File with the
event’s eventId). Setting it as the event’s single cover (coverImageId) is
done by the inline-upload path, which the Node SDK does not yet expose.
