Skip to content

nylas-samples/node-code-sample-starter

Repository files navigation

node-code-sample-starter

This sample repo will show you how to easily to get started with the Nylas Node.js SDK.

Setup

System dependencies

  • Node.js v16.x

Gather environment variables

You'll need the following values:

ACCESS_TOKEN = ""
CLIENT_ID = ""
CLIENT_SECRET = ""

Add the above values to a .env file:

Install dependencies

$ npm i

Usage

Run the script using following commands:

$ npm run build
$ node build/index.js

When you run the script, you'll get account information output in your terminal:

{
    ...
    id: '<ACCOUNT_ID>',
    accountId: '<ACCOUNT_ID>',
    object: 'account',
    name: '<ACCOUNT_NAME>',
    emailAddress: '<ACCOUNT_EMAIL>',
    provider: '<EMAIL_PROVIDER>',
    organizationUnit: 'label',
    syncState: 'running',
    linkedAt: 2022-04-21T14:48:14.000Z,
    accessToken: ''
  }
}

Learn more

Visit our Nylas Node.js SDK documentation to learn more.

Releases

No releases published

Packages

No packages published