Client library for CalDAV
npm install --save caldavjs-nextcloud
settings: {
username: "",
password: "",
access_token: "An access token to use in place of username/password (not used unless setup in Nextcloud)",
server: "https://cloud.example.com:3333 or https://cloud.example.com:3333/nextcloud", //NO trailing "/"
basePath: "The absolute path for caldav calls, e.g. /remote.php/dav for Nextcloud", //YES lead "/"; NO trailing "/"
principalPath: "The relative path where principals can be found, e.g. /principals/users", //YES lead "/"; NO trailing "/",
timezone: "America/Chicago", //sets the default, can be overridden in methods
parserLogging: true //toggles verbose logging from the calendar parser
}
caldav.listCalendars({}).then(data => {
console.log(data);
});
Access and update calendar data using the CalDAV protocol
caldav.listEvents({
"filename": "/calendars/admin/calendar-name-at-end-of-private-link",
"start": "20200601T000000Z",
"end": "20200630T115959Z",
})
object
string
date-time
date-time
array
object
boolean
string
string
string
string
string
string
string
string
string
comma separatedjson
all event data which was not parsedcaldav.createCalendar({
"name": "",
"timezone": "", // only to override settings
"filename": ""
})
object
string
string
string
string
string
caldav.listCalendars({})
object
array
object
string
string
string
string
caldav.deleteCalendar({
"filename": "/calendars/admin/calendar-name-at-end-of-private-link"
})
object
string
string
caldav.getChanges({
"filename": "/calendars/admin/calendar-name-at-end-of-private-link"
"syncToken": "http://sabre.io/ns/sync/90"
})
object
string
string
//obtained from list calendarsobject
string
array
object
string
string
caldav.createEvent({
"allDay": false,
"start": "ISODateString",
"end": "ISODateString",
"summary": "title",
"filename": "/calendars/admin/calendar-name-at-end-of-private-link/unique-filename-for-this-event",
"location": "wherever",
"description": "tell them about it",
"timezone": "America/Chicago", //only to override settings
"color": "green",
"categories": [
{ "name" : "awesome" },
{ "name" : "tags" },
{ "name" : "go" },
{ "name" : "here" }
],
"attendees": [
{
"name": "name",
"email": "test@example.com",
"mailto": "test@example.com", //to override email
"type": "one of: individual, group, room, resource, unknown"
}
],
"organizer":
{
"name": "name",
"email": "test@example.com",
"mailto": "test@example.com", //to override email
}
})
object
string
string
string
string
string
string
string
string
string
array
of objects
string
array
of objects
string
string
string
string
one of "individual", "group", "room", "resource", "unknown"object
string
string
string
string
caldav.deleteEvent({
"filename": ""
})
object
string
string