Skip to main content
RSVP methods are exposed on the AmityEvent object returned by the event repository. Use them after you have loaded or created an event.
Flutter does not currently expose public scheduled-event RSVP APIs in the SDK source reviewed for this page.

Status Values

MeaningTypeScriptiOSAndroid
GoingAmityEventResponseStatus.Going.goingAmityEventResponseStatus.GOING
InterestedNot exposed by the current TypeScript enum reviewed for this page.interestedAmityEventResponseStatus.INTERESTED
Not goingAmityEventResponseStatus.NotGoing.notGoingAmityEventResponseStatus.NOT_GOING

Parameters

ParameterMethodsPlatformsDescription
eventAll RSVP methodsTypeScript, iOS, AndroidLoaded AmityEvent object that exposes RSVP methods.
statusCreate, update, queryTypeScript, iOS, AndroidRSVP status to create, update, or filter.
eventIdLoad before RSVPTypeScript, iOS, AndroidEvent ID used to retrieve the event object first.
Pagination callback or collectionQuery RSVPsTypeScript, iOS, AndroidReturned RSVP list or live collection for rendering attendees.

Create RSVP

Create an RSVP when a user responds to an event for the first time. The examples load the event first, then call createRSVP on the returned event object.
import { AmityEventResponseStatus, EventRepository } from '@amityco/ts-sdk';

const unsubscribe = EventRepository.getEvent(
  'event-123',
  async ({ data: event, loading, error }) => {
    if (loading) return;
    if (error) {
      handleError(error);
      return;
    }
    if (!event) return;

    const rsvp = await event.createRSVP(AmityEventResponseStatus.Going);
    showSuccessMessage(rsvp?.status);
  },
);

unsubscribe();

Update RSVP

Update an RSVP when a user changes their response. Use the same event object flow, but pass the new status to updateRSVP.
import { AmityEventResponseStatus, EventRepository } from '@amityco/ts-sdk';

const unsubscribe = EventRepository.getEvent(
  'event-123',
  async ({ data: event, loading, error }) => {
    if (loading) return;
    if (error) {
      handleError(error);
      return;
    }
    if (!event) return;

    const rsvp = await event.updateRSVP(AmityEventResponseStatus.NotGoing);
    showSuccessMessage(rsvp?.status);
  },
);

unsubscribe();

Get My RSVP

Get the active user’s RSVP for an event when the UI needs to show the current response before offering update actions.
import { EventRepository } from '@amityco/ts-sdk';

const unsubscribe = EventRepository.getEvent(
  'event-123',
  async ({ data: event, loading, error }) => {
    if (loading) return;
    if (error) {
      handleError(error);
      return;
    }
    if (!event) return;

    const rsvp = await event.getMyRSVP();
    showSuccessMessage(rsvp?.status);
  },
);

unsubscribe();

Query RSVPs

Query RSVP responses when you need to render attendee lists, counts by status, or moderation views. Filter by status when the screen only needs one response group.
import { AmityEventResponseStatus, EventRepository } from '@amityco/ts-sdk';

let rsvpUnsubscribe: Amity.Unsubscriber | undefined;

const unsubscribe = EventRepository.getEvent(
  'event-123',
  ({ data: event, loading, error }) => {
    if (loading) return;
    if (error) {
      handleError(error);
      return;
    }
    if (!event) return;

    rsvpUnsubscribe = event.getRSVPs(
      { status: AmityEventResponseStatus.Going },
      ({ data: responses, loading, error }) => {
        if (loading) return;
        if (error) {
          handleError(error);
          return;
        }

        renderResults(responses);
      },
    );
  },
);

rsvpUnsubscribe?.();
unsubscribe();

Response Fields

AmityEventResponse includes the event ID, user ID, status, linked user when available, creation time, update time, and the time the user responded. Android also exposes an RSVP ID through getRsvpId().

Create Event

Create the event before collecting RSVP responses.

Manage Events

Get and query event objects before calling RSVP methods.

Events Overview

Review event coverage, fields, and status values.