iCloud Calendars not being read

Hello!

I am trying to read my calendar events for a widget, and my events do not seem to be fetchable by Scriptable. I do have events scheduled for today in various iCloud calendars, but no script I write or download reads them.

For example, this simple script returns nothing despite events existing in iCloud. I have already given Scriptable access to my calendars.

let todayEvents = await CalendarEvent.today([])

for (const event of todayEvents) {
	console.log(event.title)
}

Am I doing something wrong? It is also not working with any downloaded scripts.

The code is correct, check scriptable permission to access calendars

I know that this question is quite old already but I wanted to add that I had to restart the app after I gave it access to my calendars.
Without restarting it didn’t work for me.