Skip to main content

Overview

useCreateEvent returns a callable that creates an event. The logged-in user becomes the creator and is auto-added to hostIds. Pass cover and/or gallery to upload images inline — the hook sends multipart/form-data automatically (requires the files-images bundle).

Usage Example

Parameters

string
required
Event title. 1–300 characters.
string
required
ISO datetime when the event starts.
"online" | "physical" | "hybrid"
required
online requires url; physical requires address or location; hybrid requires both.
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 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. Defaults to true.
string[]
Additional host user IDs (the logged-in user is auto-added).
Record<string, any>
Arbitrary key-value data. Up to 1 MB.
{ file: File | RNFile; options?: UploadImageOptions }
Single cover image to upload. Sends multipart. Requires the files-images bundle.
Gallery images to upload (up to 10). Sends multipart. Requires the files-images bundle.

Returns

Returns a Promise<Event> — the created Event with inline rsvpCounts.

See Also