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.
string
required
Event title. 1–300 characters.
string
required
ISO datetime when the event starts.
"online" | "physical" | "hybrid"
required
Event format.
online requires url; physical requires address or location; hybrid requires both.string
The user to create the event as (creator + first host). With a service key this may be any user.
string
Optional description.
string
Optional ISO end datetime.
string
Optional IANA timezone.
string
Join/stream URL.
string
Venue name.
string
Street address.
{ latitude: number; longitude: number }
Coordinates for proximity search.
string
Scope the event to a space. Required when
visibility is "members"."public" | "members" | "invite"
Defaults to
"public".number
Max
going RSVPs. Omit for unlimited.boolean
Allow
"maybe" RSVPs. Defaults to true.boolean
Expose the named guest list to non-hosts. Defaults to
true.string[]
Additional host user IDs (the creator is always added).
object
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).
string
required
The event ID.
string
Comma-separated associations:
"user", "space", "files", "userRsvp".string
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.
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. Defaults to
"asc"."upcoming" | "ongoing" | "past"
Derived time window.
string
ISO datetime lower bound on
startTime.string
ISO datetime upper bound on
startTime.string
Restrict to one space.
string
Only events this user hosts.
"online" | "physical" | "hybrid"
Filter by type.
"active" | "cancelled"
Defaults to
"active".string
Comma-separated statuses the requester RSVP’d with, e.g.
"going,maybe". Requires userId.{ latitude: string; longitude: string; radius: string }
Proximity filter (radius in meters).
{ hasTitle?; includes?; doesNotInclude? }
Free-text filter on
title.{ hasDescription?; includes?; doesNotInclude? }
Free-text filter on
description.string
Comma-separated associations.
string
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.
string
required
The event ID.
string
New title.
string
New description.
string
New ISO start datetime.
string
New ISO end datetime.
string
New timezone.
"online" | "physical" | "hybrid"
New type (re-validates location fields).
string
New URL.
string
New venue name.
string
New address.
{ latitude: number; longitude: number }
New coordinates.
"public" | "members" | "invite"
New visibility.
number
New capacity.
boolean
Allow
"maybe" RSVPs.boolean
Expose the guest list.
object
New metadata.
Promise<Event>
cancelEvent
Cancels an event (setsstatus: "cancelled"). The event stays fetchable but rejects new RSVPs.
string
required
The event ID.
Promise<Event>
deleteEvent
Permanently (or soft-, per the project’seventDeletion settings) deletes an event and cleans up its RSVPs and invites.
string
required
The event ID.
Promise<void>
setRsvp
Sets or changes a user’s RSVP. Transitions intogoing are capacity-checked.
string
required
The event ID.
"going" | "maybe" | "not_going"
required
The RSVP response.
string
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.string
required
The event ID.
string
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.
string
required
The event ID.
string
required
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.string
required
The event ID.
string
required
The host to remove.
Promise<Event>
addInvite
Invites a user to the event. Idempotent. TheuserId is the target invitee.
string
required
The event ID.
string
required
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.string
required
The event ID.
string
required
The invitee to remove.
Promise<Event>
fetchInvitees
Host-only invitee (guest) list. Returns paginated EventInvite records with the invited user populated.string
required
The event ID.
number
Page number (1-indexed).
number
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.
string
required
The event ID.
string
Comma-separated statuses to filter by, e.g.
"going,maybe". Omit for all.number
Page number (1-indexed).
number
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.
