This sample repo will show you how to easily send calendar event notifications with the Nylas Node.js SDK.
- Node.js v16.x
You'll need the following values:
ACCESS_TOKEN = ""
CLIENT_ID = ""
CLIENT_SECRET = ""
Add the above values to a .env file:
$ npm iRun the script using following commands:
$ npm run build
$ node build/index.jsThe index.js consists of functions for different calendar functions:
createCalendarEventto create a calendar event (you should do this first)addEmailNotificationto add an email notification to the calendar eventaddSMSNotificationto add a SMS notification to the calendar eventaddWebhookNotificationto add a webhook notification to the calendar event
By commenting out the function (and import), you can run the specific function as follows:
import createCalendarEvent from './listCalendars';
\\...commented out imports
createCalendarEvent();
\\...commented out function calls
Be sure to check if any specific data is required. For example createCalendarEvent.ts requires a few pieces of data like replacing <CALENDAR_ID>.
Visit our Nylas Node.js SDK documentation to learn more.