This sample repo will show you how to easily to get started with the Nylas Node.js SDK to manage calendars and events using the Nylas API v3.
- Node.js v16.x
You'll need the following values:
GRANT_ID = ""
SERVER_URL = ""
API_KEY = ""
Add the above values to a .env file. All values can be retrieved from the Nylas Dashboard.
$ npm iRun the script using following commands:
$ npm run build
$ node build/index.jsComment out the specific functions to test out:
// List out all calendars
listCalendars()
// Create a new calendar
// createCalendar()
// Create a new calendar event
// createEvent()
// Update calendar event
// updateEvent()
// Destroy calendar event
// destroyEvent()
Be sure to provide the .env and specific variables required for each function.
When you run the script, you'll get all calendar information output in your terminal:
{
calendars: {
requestId: 'requestId',
data: [
# ...Calendar Data...
],
next: [Function: bound ]
}
}Visit our Nylas Node.js SDK documentation to learn more.