Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Creating Grants using Nylas Node.js SDK

This sample will show you to easily create grants with the Nylas Node.js SDK.

Setup

1. In the root folder, create a .env file with your nylas configuration as follow:

API_KEY="YOUR_API_KEY"
CLIENT_ID="YOUR_CLIENT_ID"
CLIENT_SECRET="YOUR_CLIENT_SECRET"

2. Install dependencies

npm install

Usage

Run the following command and go to http://localhost:3000/oauth

npm start

Output

ON BROWSER

{
  accessToken: 'token',
  grantId: 'id',
  email: '[email protected]',
  expiresIn: 3600,
  idToken: 'token',
  tokenType: 'Bearer',
  scope: 'scope1 scope2'
}

TERMINAL OUTPUT

GRANT ID: <GRANT_ID>