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 i
Run the script using following commands:
$ npm run build
$ node build/index.js
The index.js consists of functions for different calendar functions:
createCalendarEvent
to create a calendar event (you should do this first)addEmailNotification
to add an email notification to the calendar eventaddSMSNotification
to add a SMS notification to the calendar eventaddWebhookNotification
to 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.