Skip to main content

gcal.googlecalendar.deleteevent

Home > @runlightyear/gcal > GoogleCalendar > deleteEvent

GoogleCalendar.deleteEvent() method

This API is in beta and may contain contain bugs. Can be used in production with caution.

Deletes an event.

Signature:
deleteEvent(props: DeleteEventProps): Promise<DeleteEventResponse>;

Parameters

ParameterTypeDescription
propsDeleteEventProps
Returns:

Promise<DeleteEventResponse>

Example

Delete event

import { defineAction } from "@runlightyear/lightyear";
import { GoogleCalendar } from "@runlightyear/gcal";

defineAction({
name: "deleteEvent",
title: "Delete Event",
apps: ["gcal"],
variables: ["calendarId?", "eventId"],
run: async ({ auths, variables }) => {
const gcal = new GoogleCalendar({
auth: auths.gcal,
});

const response = await gcal.deleteEvent({
calendarId: variables.calendarId || "primary",
eventId: variables.eventId!,
});

console.log("Response: ", response.data);
},
});