Skip to main content
Use event repository APIs to observe a single event, query event collections, update event fields, and delete events.
Flutter does not currently expose public scheduled-event management APIs in the SDK source reviewed for this page.

Parameters

InputMethodsPlatformsDescription
eventIdGet, update, deleteTypeScript, iOS, AndroidStable ID of the event to read or mutate.
originType, originIdQueryTypeScript, iOS, AndroidScope events to a community or user origin.
userId, onlyAttendeeQuery my RSVP eventsTypeScript, iOS, AndroidFilter events by attendee or user context.
statusQueryTypeScript, iOS, AndroidFilter by scheduled, live, ended, or cancelled status.
typeQueryTypeScript, iOS, AndroidFilter by virtual or in-person event type.
sortBy, orderByQueryTypeScript, iOS, AndroidSort event lists by start time or creation time.
Event fieldsUpdateTypeScript, iOS, AndroidMutable fields such as title, external URL, description, location, tags, and metadata.

Get an Event

Use this method for event detail screens or any flow that needs the latest state of one event. TypeScript and iOS expose observable objects; Android returns the requested event through the repository.
import { EventRepository } from '@amityco/ts-sdk';

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

    showSuccessMessage(event.title);
  },
);

unsubscribe();

Query Events

Use event queries to build calendar lists, community event lists, and upcoming-event surfaces. Pass origin, status, type, sort, and order filters that match the list your UI needs.
import {
  AmityEventOrderOption,
  AmityEventOriginType,
  AmityEventSortOption,
  AmityEventStatus,
  EventRepository,
} from '@amityco/ts-sdk';

const unsubscribe = EventRepository.getEvents(
  {
    originType: AmityEventOriginType.Community,
    originId: communityId,
    status: AmityEventStatus.Scheduled,
    sortBy: AmityEventSortOption.StartTime,
    orderBy: AmityEventOrderOption.Ascending,
  },
  ({ data: events, loading, error, hasNextPage, onNextPage }) => {
    if (loading) return;
    if (error) {
      handleError(error);
      return;
    }

    renderResults(events);

    if (hasNextPage) {
      onNextPage?.();
    }
  },
);

unsubscribe();

Query My RSVP Events

Use this flow when the current screen should show events connected to a user’s RSVP or attendance state. The SDKs expose this through event query filters rather than a separate event object method.
import { AmityEventResponseStatus, EventRepository } from '@amityco/ts-sdk';

const unsubscribe = EventRepository.getMyEvents(
  { status: AmityEventResponseStatus.Going },
  ({ data: events, loading, error }) => {
    if (loading) return;
    if (error) {
      handleError(error);
      return;
    }

    renderResults(events);
  },
);

unsubscribe();

Update an Event

Use update when the current user can edit the event and your app has collected the changed fields. The examples update the title and virtual-event URL.
import { EventRepository } from '@amityco/ts-sdk';

const { data: event } = await EventRepository.updateEvent('event-123', {
  title: 'Updated Community Workshop',
  externalUrl: 'https://example.com/updated-live',
});

showSuccessMessage(event.title);

Delete an Event

Use delete for event owner or moderator flows where removing the event is allowed by backend permissions. Handle errors in your UI because permission and lifecycle rules are enforced server-side.
import { EventRepository } from '@amityco/ts-sdk';

await EventRepository.deleteEvent('event-123');
showSuccessMessage('Event deleted');

Query Filters

FilterTypeScriptiOSAndroid
OriginoriginType, originIdoriginType, originId.originType(...), .originId(...)
Creator or attendee useruserId, onlyAttendeeuserId, onlyAttendee.userId(...), .onlyAttendee(...)
StatusAmityEventStatus.Scheduled, Live, Ended, Cancelled.scheduled, .live, .ended, .cancelledAmityEventStatus.SCHEDULED, LIVE, ENDED, CANCELLED
TypeAmityEventType.Virtual, InPerson.virtual, .inPersonAmityEventType.VIRTUAL, IN_PERSON
SortAmityEventSortOption.StartTime, CreatedAt.startTime, .createdAtAmityEventSortOption.START_TIME, CREATED_AT
OrderAmityEventOrderOption.Ascending, Descending.ascending, .descendingAmityEventOrderOption.ASCENDING, DESCENDING
TypeScript deleteEvent returns void. Android returns a Completable; iOS returns from an async throwing function when deletion completes.

Create Event

Create scheduled virtual or in-person events.

Event RSVP

Work with RSVP responses on event objects.

Events Overview

Review event fields, coverage, and common flows.