This is the GitHub repository for the Nylas Node SDK and this repo is primarily for anyone who wants to make contributions to the SDK or install it from source. If you are looking to use Node to access the Nylas Email, Calendar, or Contacts API you should refer to our official Node SDK Quickstart Guide.
The Nylas Communications Platform provides REST APIs for Email, Calendar, and Contacts, and the Node SDK is the quickest way to build your integration using JavaScript.
Here are some resources to help you get started:
Note: The Nylas Node SDK requires Node.js v16 or later.
To run the Nylas Node SDK, you will first need to have Node and npm installed on your machine.
Then, head to the nearest command line and run the following:
npm install nylas
Alternatively, if you prefer to use Yarn, you can install the Nylas Node SDK with yarn add nylas
To install this package from source, clone this repo and run npm install
from inside the project directory.
git clone https://github.com/nylas/nylas-nodejs.git
cd nylas-nodejs
npm install
To use this SDK, you must first get a free Nylas account.
Then, follow the Quickstart guide to set up your first app and get your API keys.
For code examples that demonstrate how to use this SDK, take a look at our Node repos in the Nylas Samples collection.
Every resource (i.e., messages, events, contacts) is accessed via an instance of Nylas
. Before making any requests, be sure to call config
and initialize the Nylas
instance with your clientId
and clientSecret
. Then, call with
and pass it your accessToken
. The accessToken
allows Nylas
to make requests for a given account's resources.
import Nylas from "nylas";
const nylas = new Nylas({
apiKey: "NYLAS_API_KEY",
});
Then, you can use Nylas to access information about a user's account:
nylas.calendars.list({ identifier: "GRANT_ID" }).then(calendars => {
console.log(calendars);
});
Nylas maintains a reference guide for the Node SDK to help you get familiar with the available methods and classes.
Please refer to Contributing for information about how to make contributions to this project. We welcome questions, bug reports, and pull requests.
This project is licensed under the terms of the MIT license. Please refer to LICENSE for the full terms.
Generated using TypeDoc