Socket
Book a DemoInstallSign in
Socket

@ebarooni/capacitor-calendar

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ebarooni/capacitor-calendar

A capacitor plugin for managing calendar events on iOS and Android, with reminders support on iOS.

7.2.0
latest
Source
npmnpm
Version published
Weekly downloads
3.9K
-0.13%
Maintainers
1
Weekly downloads
 
Created
Source

capacitor-calendar-logo
A capacitor plugin for managing calendar events on iOS and Android, with reminders support on iOS.


Table of Contents

Installation

npm install @ebarooni/capacitor-calendar
npx cap sync

Demo

iOS 18Android 15

Setup

This plugin requires additional platform-specific configuration. Follow the official guides:

Documentation

For comprehensive usage examples, detailed explanations, and API references, check out:

Changelog

See CHANGELOG.md for the latest updates and release history.

[!NOTE]
Version 7.1.0 introduces breaking changes.

API

checkPermission(...)

checkPermission(options: { scope: CalendarPermissionScope; }) => Promise<{ result: PermissionState; }>

Retrieves the current permission state for a given scope.

ParamType
options{ scope: CalendarPermissionScope; }

Returns: Promise<{ result: PermissionState; }>

Since: 0.1.0

Platform: Android, iOS

checkAllPermissions()

checkAllPermissions() => Promise<{ result: CheckAllPermissionsResult; }>

Retrieves the current state of all permissions.

Returns: Promise<{ result: CheckAllPermissionsResult; }>

Since: 0.1.0

Platform: Android, iOS

requestPermission(...)

requestPermission(options: { scope: CalendarPermissionScope; }) => Promise<{ result: PermissionState; }>

Requests permission for a given scope.

ParamType
options{ scope: CalendarPermissionScope; }

Returns: Promise<{ result: PermissionState; }>

Since: 0.1.0

Platform: Android, iOS

requestAllPermissions()

requestAllPermissions() => Promise<{ result: RequestAllPermissionsResult; }>

Requests permission for all calendar and reminder permissions.

Returns: Promise<{ result: CheckAllPermissionsResult; }>

Since: 0.1.0

Platform: Android, iOS

requestWriteOnlyCalendarAccess()

requestWriteOnlyCalendarAccess() => Promise<{ result: PermissionState; }>

Requests write access to the calendar.

Returns: Promise<{ result: PermissionState; }>

Since: 5.4.0

Platform: Android, iOS

requestReadOnlyCalendarAccess()

requestReadOnlyCalendarAccess() => Promise<{ result: PermissionState; }>

Requests read access to the calendar.

Returns: Promise<{ result: PermissionState; }>

Since: 5.4.0

Platform: Android

requestFullCalendarAccess()

requestFullCalendarAccess() => Promise<{ result: PermissionState; }>

Requests read and write access to the calendar.

Returns: Promise<{ result: PermissionState; }>

Since: 5.4.0

Platform: Android, iOS

requestFullRemindersAccess()

requestFullRemindersAccess() => Promise<{ result: PermissionState; }>

Requests read and write access to the reminders.

Returns: Promise<{ result: PermissionState; }>

Since: 5.4.0

Platform: iOS

createEventWithPrompt(...)

createEventWithPrompt(options?: CreateEventWithPromptOptions | undefined) => Promise<{ id: string | null; }>

Opens the system calendar interface to create a new event. On Android always returns null. Fetch the events to find the ID of the newly created event.

ParamType
optionsCreateEventWithPromptOptions

Returns: Promise<{ id: string | null; }>

Since: 0.1.0

Platform: Android, iOS

modifyEventWithPrompt(...)

modifyEventWithPrompt(options: ModifyEventWithPromptOptions) => Promise<{ result: EventEditAction | null; }>

Opens a system calendar interface to modify an event. On Android always returns null.

ParamType
optionsModifyEventWithPromptOptions

Returns: Promise<{ result: EventEditAction | null; }>

Since: 6.6.0

Platform: Android, iOS

createEvent(...)

createEvent(options: CreateEventOptions) => Promise<{ id: string; }>

Creates an event in the calendar.

ParamType
optionsCreateEventOptions

Returns: Promise<{ id: string; }>

Since: 0.4.0

Platform: iOS, Android

modifyEvent(...)

modifyEvent(options: ModifyEventOptions) => Promise<void>

Modifies an event.

ParamType
optionsModifyEventOptions

Since: 6.6.0

Platform: Android, iOS

deleteEventsById(...)

deleteEventsById(options: DeleteEventsByIdOptions) => Promise<{ result: DeleteEventsByIdResult; }>

Deletes multiple events.

ParamType
optionsDeleteEventsByIdOptions

Returns: Promise<{ result: DeleteEventsByIdResult; }>

Since: 0.11.0

Platform: Android, iOS

deleteEvent(...)

deleteEvent(options: DeleteEventOptions) => Promise<void>

Deletes an event.

ParamType
optionsDeleteEventOptions

Since: 7.1.0

Platform: Android, iOS

deleteEventWithPrompt(...)

deleteEventWithPrompt(options: DeleteEventWithPromptOptions) => Promise<{ deleted: boolean; }>

Opens a dialog to delete an event.

ParamType
optionsDeleteEventWithPromptOptions

Returns: Promise<{ deleted: boolean; }>

Since: 7.1.0

Platform: Android, iOS

listEventsInRange(...)

listEventsInRange(options: ListEventsInRangeOptions) => Promise<{ result: CalendarEvent[]; }>

Retrieves the events within a date range.

ParamType
optionsListEventsInRangeOptions

Returns: Promise<{ result: CalendarEvent[]; }>

Since: 0.10.0

Platform: Android, iOS

commit()

commit() => Promise<void>

Save the changes to the calendar.

Since: 7.1.0

Platform: iOS

selectCalendarsWithPrompt(...)

selectCalendarsWithPrompt(options?: SelectCalendarsWithPromptOptions | undefined) => Promise<{ result: Calendar[]; }>

Opens a system interface to choose one or multiple calendars.

ParamType
optionsSelectCalendarsWithPromptOptions

Returns: Promise<{ result: Calendar[]; }>

Since: 0.2.0

Platform: iOS

fetchAllCalendarSources()

fetchAllCalendarSources() => Promise<{ result: CalendarSource[]; }>

Retrieves a list of calendar sources.

Returns: Promise<{ result: CalendarSource[]; }>

Since: 6.6.0

Platform: iOS

listCalendars()

listCalendars() => Promise<{ result: Calendar[]; }>

Retrieves a list of all available calendars.

Returns: Promise<{ result: Calendar[]; }>

Since: 7.1.0

Platform: Android, iOS

getDefaultCalendar()

getDefaultCalendar() => Promise<{ result: Calendar | null; }>

Retrieves the default calendar.

Returns: Promise<{ result: Calendar | null; }>

Since: 0.3.0

Platform: Android, iOS

openCalendar(...)

openCalendar(options?: OpenCalendarOptions | undefined) => Promise<void>

Opens the calendar app.

ParamType
optionsOpenCalendarOptions

Since: 7.1.0

Platform: Android, iOS

createCalendar(...)

createCalendar(options: CreateCalendarOptions) => Promise<{ id: string; }>

Creates a calendar.

ParamType
optionsCreateCalendarOptions

Returns: Promise<{ id: string; }>

Since: 5.2.0

Platform: Android, iOS

deleteCalendar(...)

deleteCalendar(options: DeleteCalendarOptions) => Promise<void>

Deletes a calendar by id.

ParamType
optionsDeleteCalendarOptions

Since: 5.2.0

Platform: Android, iOS

modifyCalendar(...)

modifyCalendar(options: ModifyCalendarOptions) => Promise<void>

Modifies a calendar with options.

ParamType
optionsModifyCalendarOptions

Since: 7.2.0

Platform: Android, iOS

fetchAllRemindersSources()

fetchAllRemindersSources() => Promise<{ result: CalendarSource[]; }>

Retrieves a list of calendar sources.

Returns: Promise<{ result: CalendarSource[]; }>

Since: 6.6.0

Platform: iOS

openReminders()

openReminders() => Promise<void>

Opens the reminders app.

Since: 7.1.0

Platform: iOS

getDefaultRemindersList()

getDefaultRemindersList() => Promise<{ result: RemindersList | null; }>

Retrieves the default reminders list.

Returns: Promise<{ result: Calendar | null; }>

Since: 7.1.0

Platform: iOS

getRemindersLists()

getRemindersLists() => Promise<{ result: RemindersList[]; }>

Retrieves all available reminders lists.

Returns: Promise<{ result: Calendar[]; }>

Since: 7.1.0

Platform: iOS

createReminder(...)

createReminder(options: CreateReminderOptions) => Promise<{ id: string; }>

Creates a reminder.

ParamType
optionsCreateReminderOptions

Returns: Promise<{ id: string; }>

Since: 0.5.0

Platform: iOS

deleteRemindersById(...)

deleteRemindersById(options: DeleteRemindersByIdOptions) => Promise<{ result: DeleteRemindersByIdResult; }>

Deletes multiple reminders.

ParamType
optionsDeleteRemindersByIdOptions

Returns: Promise<{ result: DeleteRemindersByIdResult; }>

Since: 5.3.0

Platform: iOS

deleteReminder(...)

deleteReminder(options: DeleteReminderOptions) => Promise<void>

Deletes a reminder.

ParamType
optionsDeleteReminderOptions

Since: 7.1.0

Platform: iOS

modifyReminder(...)

modifyReminder(options: ModifyReminderOptions) => Promise<void>

Modifies a reminder.

ParamType
optionsModifyReminderOptions

Since: 6.7.0

Platform: iOS

getReminderById(...)

getReminderById(options: GetReminderByIdOptions) => Promise<{ result: Reminder | null; }>

Retrieve a reminder by ID.

ParamType
optionsGetReminderByIdOptions

Returns: Promise<{ result: Reminder | null; }>

Since: 7.1.0

Platform: iOS

getRemindersFromLists(...)

getRemindersFromLists(options: GetRemindersFromListsOptions) => Promise<{ result: Reminder[]; }>

Retrieves reminders from multiple lists.

ParamType
optionsGetRemindersFromListsOptions

Returns: Promise<{ result: Reminder[]; }>

Since: 5.3.0

Platform: iOS

deleteReminderWithPrompt(...)

deleteReminderWithPrompt(options: DeleteReminderWithPromptOptions) => Promise<{ deleted: boolean; }>

Opens a dialog to delete a reminder.

ParamType
optionsDeleteReminderWithPromptOptions

Returns: Promise<{ deleted: boolean; }>

Since: 7.2.0

Platform: iOS

Interfaces

CreateEventWithPromptOptions

PropTypeDescriptionSincePlatform
titlestring0.1.0Android, iOS
calendarIdstring0.1.0iOS
locationstring0.1.0Android, iOS
startDatenumber0.1.0Android, iOS
endDatenumber0.1.0Android, iOS
isAllDayboolean0.1.0Android, iOS
alertsnumber[]Sets alerts before or after the start of the event in minutes. On iOS only 2 alerts are supported.7.1.0iOS
urlstring0.1.0iOS
descriptionstring7.1.0Android, iOS
availabilityEventAvailability7.1.0Android, iOS
inviteesstring[]An array of emails to invite.7.1.0Android

ModifyEventWithPromptOptions

PropTypeDescriptionSincePlatform
titlestring0.1.0Android, iOS
calendarIdstring0.1.0iOS
locationstring0.1.0Android, iOS
startDatenumber0.1.0Android, iOS
endDatenumber0.1.0Android, iOS
isAllDayboolean0.1.0Android, iOS
alertsnumber[]Sets alerts before or after the start of the event in minutes. On iOS only 2 alerts are supported.7.1.0iOS
urlstring0.1.0iOS
descriptionstring7.1.0Android, iOS
availabilityEventAvailability7.1.0Android, iOS
inviteesstring[]An array of emails to invite.7.1.0Android
idstringThe ID of the event to be modified.7.1.0Android, iOS

CreateEventOptions

PropTypeDescriptionDefaultSincePlatform
titlestring0.4.0Android, iOS
calendarIdstring0.1.0Android, iOS
locationstring0.1.0Android, iOS
startDatenumber0.1.0Android, iOS
endDatenumber0.1.0Android, iOS
isAllDayboolean0.1.0Android, iOS
alertsnumber[]7.1.0Android, iOS
urlstring0.1.0iOS
descriptionstring7.1.0Android, iOS
availabilityEventAvailability7.1.0Android, iOS
organizerstringEmail of the event organizer.7.1.0Android
colorstring7.1.0Android
durationstringDuration of the event in RFC2445 format.7.1.0Android
commitbooleanWhether to save immediately (true) or batch changes for later (false).true7.1.0iOS
attendeesEventGuest[]The event guests.7.1.0Android

EventGuest

PropTypeSince
namestring7.1.0
emailstring7.1.0

ModifyEventOptions

PropTypeDescriptionDefaultSincePlatform
idstringThe ID of the event to be modified.7.1.0Android, iOS
titlestring0.4.0Android, iOS
calendarIdstring0.1.0Android, iOS
locationstring0.1.0Android, iOS
startDatenumber0.1.0Android, iOS
endDatenumber0.1.0Android, iOS
isAllDayboolean0.1.0Android, iOS
alertsnumber[]7.1.0Android, iOS
urlstring0.1.0iOS
descriptionstring7.1.0Android, iOS
availabilityEventAvailability7.1.0Android, iOS
organizerstringEmail of the event organizer.7.1.0Android
colorstring7.1.0Android
durationstringDuration of the event in RFC2445 format.7.1.0Android
attendeesEventGuest[]The event guests.7.1.0Android
spanEventSpanThe span of modifications.EventSpan.THIS_EVENTiOS

DeleteEventsByIdResult

PropTypeSince
deletedstring[]7.1.0
failedstring[]7.1.0

DeleteEventsByIdOptions

PropTypeDescriptionDefaultSincePlatform
idsstring[]7.1.0
spanEventSpanThe span of deletion.EventSpan.THIS_EVENTiOS

DeleteEventOptions

PropTypeDescriptionDefaultSincePlatform
idstring7.1.0
spanEventSpanThe span of deletion.EventSpan.THIS_EVENTiOS

DeleteEventWithPromptOptions

PropTypeDescriptionDefaultSincePlatform
idstring7.1.0
spanEventSpanThe span of deletion.EventSpan.THIS_EVENTiOS
titlestringTitle of the dialog.7.1.0Android, iOS
messagestringMessage of the dialog.7.1.0Android, iOS
confirmButtonTextstringText to show on the confirm button.'Delete'7.1.0Android, iOS
cancelButtonTextstringText to show on the cancel button.'Cancel'7.1.0Android, iOS

CalendarEvent

PropTypeSincePlatform
idstring7.1.0Android, iOS
titlestring7.1.0Android, iOS
calendarIdstring | null7.1.0Android, iOS
locationstring | null7.1.0Android, iOS
startDatenumber7.1.0Android, iOS
endDatenumber7.1.0Android, iOS
isAllDayboolean7.1.0Android, iOS
alertsnumber[]7.1.0Android, iOS
urlstring | null7.1.0iOS
descriptionstring | null7.1.0Android, iOS
availabilityEventAvailability | null7.1.0Android, iOS
organizerstring | null7.1.0Android, iOS
colorstring | null7.1.0Android, iOS
durationstring | null7.1.0Android
isDetachedboolean | null7.1.0iOS
birthdayContactIdentifierstring | null7.1.0iOS
statusEventStatus | null7.1.0Android, iOS
creationDatenumber | null7.1.0iOS
lastModifiedDatenumber | null7.1.0iOS
attendees{ email: string | null; name: string | null; role: AttendeeRole | null; status: AttendeeStatus | null; type: AttendeeType | null; }[]7.1.0Android, iOS
timezonestring | null7.1.0Android, iOS

ListEventsInRangeOptions

PropTypeDescriptionSince
fromnumberThe timestamp in milliseconds.7.1.0
tonumberThe timestamp in milliseconds.7.1.0

Calendar

PropTypeDescriptionSincePlatform
idstring7.1.0Android, iOS
titlestring7.1.0Android, iOS
internalTitlestring | nullInternal name of the calendar (CalendarContract.Calendars.NAME).7.1.0Android
colorstring7.1.0Android, iOS
isImmutableboolean | null7.1.0iOS
allowsContentModificationsboolean | null7.1.0iOS
typeCalendarType | null7.1.0iOS
isSubscribedboolean | null7.1.0iOS
sourceCalendarSource | null7.1.0iOS
visibleboolean | nullIndicates if the events from this calendar should be shown.7.1.0Android
accountNamestring | nullThe account under which the calendar is registered.7.1.0Android
ownerAccountstring | nullThe owner of the calendar.7.1.0Android
maxRemindersnumber | nullMaximum number of reminders allowed per event.7.1.0Android
locationstring | null7.1.0Android

CalendarSource

PropTypeSince
typeCalendarSourceType7.1.0
idstring7.1.0
titlestring7.1.0

SelectCalendarsWithPromptOptions

PropTypeDescriptionDefaultSince
displayStyleCalendarChooserDisplayStyleCalendarChooserDisplayStyle.ALL_CALENDARS7.1.0
multiplebooleanAllow multiple selections.false7.1.0

OpenCalendarOptions

PropTypeDefaultSince
datenumberDate.now()7.1.0

CreateCalendarOptions

PropTypeDescriptionSincePlatform
titlestring5.2.0Android, iOS
colorstringThe color of the calendar. Should be provided on Android.5.2.0Android, iOS
sourceIdstring5.2.0iOS
accountNamestringOnly needed on Android. Typically set to an email address.7.1.0Android
ownerAccountstringOnly needed on Android. Typically set to an email address.7.1.0Android

DeleteCalendarOptions

PropTypeSince
idstring7.1.0

ModifyCalendarOptions

PropTypeSincePlatform
idstring7.2.0Android, iOS
titlestring7.2.0Android, iOS
colorstring7.2.0Android, iOS

CreateReminderOptions

PropTypeSince
titlestring7.1.0
listIdstring7.1.0
prioritynumber7.1.0
isCompletedboolean7.1.0
startDatenumber7.1.0
dueDatenumber7.1.0
completionDatenumber7.1.0
notesstring7.1.0
urlstring7.1.0
locationstring7.1.0
recurrenceRecurrenceRule7.1.0
alertsnumber[]7.1.0

RecurrenceRule

PropTypeDescriptionSince
frequencyRecurrenceFrequency7.1.0
intervalnumberHow often it repeats (e.g. 1 for every occurrence, 2 for every second occurrence).7.1.0
endnumberTimestamp of when the recurrence ends.7.1.0

DeleteRemindersByIdResult

PropTypeSince
deletedstring[]7.1.0
failedstring[]7.1.0

DeleteRemindersByIdOptions

PropTypeSince
idsstring[]7.1.0

DeleteReminderOptions

PropTypeSince
idstring7.1.0

ModifyReminderOptions

PropTypeSince
idstring7.1.0
titlestring7.1.0
listIdstring7.1.0
prioritynumber7.1.0
isCompletedboolean7.1.0
startDatenumber7.1.0
dueDatenumber7.1.0
completionDatenumber7.1.0
notesstring7.1.0
urlstring7.1.0
locationstring7.1.0
recurrenceRecurrenceRule7.1.0
alertsnumber[]7.1.0

Reminder

PropTypeSince
idstring7.1.0
titlestring | null7.1.0
listIdstring | null7.1.0
isCompletedboolean7.1.0
prioritynumber | null7.1.0
notesstring | null7.1.0
locationstring | null7.1.0
urlstring | null7.1.0
startDatenumber | null7.1.0
dueDatenumber | null7.1.0
completionDatenumber | null7.1.0
recurrenceRecurrenceRule[]7.1.0
alertsnumber[]7.1.0

GetReminderByIdOptions

PropTypeSince
idstring7.1.0

GetRemindersFromListsOptions

PropTypeSince
listIdsstring[]7.1.0

DeleteReminderWithPromptOptions

PropTypeDescriptionDefaultSince
idstring7.2.0
titlestringTitle of the dialog.7.2.0
messagestringMessage of the dialog.7.2.0
confirmButtonTextstringText to show on the confirm button.'Delete'7.2.0
cancelButtonTextstringText to show on the cancel button.'Cancel'7.2.0

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

CheckAllPermissionsResult

Record< CalendarPermissionScope, PermissionState >

Record

Construct a type with a set of properties K of type T

{ [P in K]: T; }

RequestAllPermissionsResult

CheckAllPermissionsResult

EventEditAction

"canceled" | "saved" | "deleted"

RemindersList

Calendar

Enums

CalendarPermissionScope

MembersValueDescriptionSincePlatform
READ_CALENDAR"readCalendar"Permission required for reading calendar events.7.1.0Android, iOS
READ_REMINDERS"readReminders"Permission required for reading reminders.7.1.0iOS
WRITE_CALENDAR"writeCalendar"Permission required for adding or modifying calendar events.7.1.0Android, iOS
WRITE_REMINDERS"writeReminders"Permission required for adding or modifying reminders.7.1.0iOS

EventAvailability

MembersValueSincePlatform
NOT_SUPPORTED-17.1.0iOS
BUSY7.1.0Android, iOS
FREE7.1.0Android, iOS
TENTATIVE7.1.0Android, iOS
UNAVAILABLE7.1.0iOS

EventSpan

MembersSince
THIS_EVENT7.1.0
THIS_AND_FUTURE_EVENTS7.1.0

EventStatus

MembersValueSincePlatform
NONE"none"7.1.0iOS
CONFIRMED"confirmed"7.1.0Android, iOS
TENTATIVE"tentative"7.1.0Android, iOS
CANCELED"canceled"7.1.0Android, iOS

AttendeeRole

MembersValueSincePlatform
UNKNOWN"unknown"7.1.0Android, iOS
REQUIRED"required"7.1.0iOS
OPTIONAL"optional"7.1.0iOS
CHAIR"chair"7.1.0iOS
NON_PARTICIPANT"nonParticipant"7.1.0Android, iOS
ATTENDEE"attendee"7.1.0Android
ORGANIZER"organizer"7.1.0Android
PERFORMER"performer"7.1.0Android
SPEAKER"speaker"7.1.0Android

AttendeeStatus

MembersValueSincePlatform
NONE"none"7.1.0Android
ACCEPTED"accepted"7.1.0Android, iOS
DECLINED"declined"7.1.0Android, iOS
INVITED"invited"7.1.0Android
UNKNOWN"unknown"7.1.0iOS
PENDING"pending"7.1.0iOS
TENTATIVE"tentative"7.1.0Android, iOS
DELEGATED"delegated"7.1.0iOS
COMPLETED"completed"7.1.0iOS
IN_PROCESS"inProcess"7.1.0iOS

AttendeeType

MembersValueSincePlatform
UNKNOWN"unknown"7.1.0Android, iOS
PERSON"person"7.1.0iOS
ROOM"room"7.1.0iOS
RESOURCE"resource"7.1.0Android, iOS
GROUP"group"7.1.0iOS
REQUIRED"required"7.1.0Android
NONE"none"7.1.0Android
OPTIONAL"optional"7.1.0Android

CalendarType

MembersSince
LOCAL7.1.0
CAL_DAV7.1.0
EXCHANGE7.1.0
SUBSCRIPTION7.1.0
BIRTHDAY7.1.0

CalendarSourceType

MembersSince
LOCAL7.1.0
EXCHANGE7.1.0
CAL_DAV7.1.0
MOBILE_ME7.1.0
SUBSCRIBED7.1.0
BIRTHDAYS7.1.0

CalendarChooserDisplayStyle

MembersSince
ALL_CALENDARS0.2.0
WRITABLE_CALENDARS_ONLY0.2.0

RecurrenceFrequency

MembersSince
DAILY7.1.0
WEEKLY7.1.0
MONTHLY7.1.0
YEARLY7.1.0

Contributing

See CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License. See LICENSE for details.

Keywords

capacitor

FAQs

Package last updated on 07 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.