Skip to main content

Overview

useAddInvite returns a callable that invites a user to an event. Host-only. Idempotent against the unique (eventId, userId) constraint. For an invite-visibility event, the invited user can now see and RSVP to it; when the notifications bundle is enabled, the invitee receives an event-invite notification.

Usage Example

import { useAddInvite } from "@sublay/react-js";

function InviteButton({ eventId }: { eventId: string }) {
  const addInvite = useAddInvite();
  return (
    <button onClick={() => addInvite({ eventId, userId: "usr_guest" })}>
      Invite
    </button>
  );
}

Parameters

eventId
string
required
The event ID.
userId
string
required
The user to invite (userId only — never a foreign ID).

Returns

Returns a Promise<Event> — the updated Event.

See Also