gcal.googlecalendar.getevent
Home > @runlightyear/gcal > GoogleCalendar > getEvent
GoogleCalendar.getEvent() method
This API is in beta and may contain contain bugs. Can be used in production with caution.
Get an event.
Signature:getEvent(props: GetEventProps): Promise<GetEventResponse>;
Parameters
Parameter | Type | Description |
---|---|---|
props | GetEventProps |
Promise<GetEventResponse>
Example
Get an event
import { defineAction } from "@runlightyear/lightyear";
import { GoogleCalendar } from "@runlightyear/gcal";
defineAction({
name: "getEvent",
title: "Get Event",
apps: ["gcal"],
variables: ["calendarId?", "eventId"],
run: async ({ auths, variables }) => {
const gcal = new GoogleCalendar({
auth: auths.gcal,
});
const response = await gcal.getEvent({
calendarId: variables.calendarId || "primary",
eventId: variables.eventId!,
});
console.log("Response: ", response.data);
},
});