How to use nylas - 3 common examples

To help you get started, we’ve selected a few nylas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nylas / nylas-nodejs / tests / auth / app.js View on Github external
credentials = require('../credentials.js');

APP_ID = credentials.APP_ID;
APP_SECRET = credentials.APP_SECRET;
AUTH_TOKEN = credentials.AUTH_TOKEN;
DEST_EMAIL = credentials.DEST_EMAIL;

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

// setup the Nylas API
global.Nylas = require('nylas').config({
  appId: APP_ID,
  appSecret: APP_SECRET,
});

// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', routes);
app.use('/threads', threads);

// catch 404 and forward to error handler
github nylas / nylas-nodejs / example / sample-app / app.js View on Github external
clientSecret: '',
};

assert.notEqual(
  nylasAppConfigs.clientId,
  '',
  'Please replace with your Nylas Client ID'
);
assert.notEqual(
  nylasAppConfigs.clientSecret,
  '',
  'Please replace with your Nylas Client Secret'
);

// setup the Nylas API
global.Nylas = require('nylas').config(nylasAppConfigs);

app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());

var sessionSecret = {
  secret: '',
};

assert.notEqual(
  sessionSecret.secret,
  '',
  'Please replace with your session secret'
);
github nylas / nylas-nodejs / tests / deltas.js View on Github external
var Nylas = require('nylas').config({
  appId: 'blah',
  appSecret: 'blah',
  apiServer: 'https://api-staging.nylas.com/',
});

credentials = require('./credentials.js');
AUTH_TOKEN = credentials.AUTH_TOKEN;
DEST_EMAIL = credentials.DEST_EMAIL;

var nylas = Nylas.with(AUTH_TOKEN);

var timestampMs = Date.now();

nylas.deltas.generateCursor(timestampMs, function(error, cursor) {
  var stream = nylas.deltas.startStream(cursor);

nylas

A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.

MIT
Latest version published 20 days ago

Package Health Score

87 / 100
Full package analysis

Popular nylas functions