How to use the plaid.Client function in plaid

To help you get started, we’ve selected a few plaid 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 azeemba / lpaid / lib / plaid-wrapper.js View on Github external
'use strict';

// external deps
var config = require('config');
var plaid = require('plaid');
var moment = require('moment');

var PLAID_CLIENT_ID = config.get('PLAID.CLIENT_ID');
var PLAID_SECRET = config.get('PLAID.SECRET');
var PLAID_PUBLIC_KEY = config.get('PLAID.PUBLIC_KEY');
var PLAID_ENV = config.get('PLAID.ENV');

// Initialize the Plaid client
var client = new plaid.Client(
  PLAID_CLIENT_ID,
  PLAID_SECRET,
  PLAID_PUBLIC_KEY,
  plaid.environments[PLAID_ENV]
);

const SIMULTANEOUS_REQS = 3;

exports.getItems = (accessTokens) => {
  let promises = accessTokens.map((token) => {
    return client.getItem(token);
  }, {concurrency: SIMULTANEOUS_REQS});
  return Promise.all(promises);
}

exports.validateItem = (accessToken) => {
github plaid / pattern / server / plaid.js View on Github external
constructor() {
    // Initialize the Plaid client.
    this.client = new plaid.Client(
      PLAID_CLIENT_ID,
      PLAID_SECRET,
      PLAID_PUBLIC_KEY,
      plaid.environments[PLAID_ENV],
      OPTIONS
    );

    // Wrap the Plaid client methods to add a logging function.
    forEach(clientMethodLoggingFns, (logFn, method) => {
      this[method] = this.createWrappedClientMethod(method, logFn);
    });
  }
github kevinschaich / mintable / src / lib / plaid / plaidClient.js View on Github external
const plaid = require('plaid')

const environment = () => {
  switch (process.env.PLAID_ENVIRONMENT) {
    case 'sandbox':
      return plaid.environments.sandbox
    case 'production':
      return plaid.environments.production
    default:
      return plaid.environments.development
  }
}

module.exports = new plaid.Client(
  process.env.PLAID_CLIENT_ID,
  process.env.PLAID_SECRET,
  process.env.PLAID_PUBLIC_KEY,
  environment(),
  {
    version: '2018-05-22'
  }
)
github kevinschaich / mintable / src / lib / plaid.js View on Github external
const pMapSeries = require('p-map-series')
const plaid = require('plaid')
const _ = require('lodash')

const environment = () => {
  switch (process.env.PLAID_ENVIRONMENT) {
    case 'sandbox':
      return plaid.environments.sandbox
    case 'production':
      return plaid.environments.production
    default:
      return plaid.environments.development
  }
}

const PLAID_CLIENT = new plaid.Client(
  process.env.PLAID_CLIENT_ID,
  process.env.PLAID_SECRET,
  process.env.PLAID_PUBLIC_KEY,
  environment(),
  {
    version: '2018-05-22'
  }
)

const fetchTransactions = (startDate, endDate, pageSize, offset) => {
  const accounts = getAccountTokens()

  const options = [
    format(startDate, 'YYYY-MM-DD'),
    format(endDate, 'YYYY-MM-DD'),
    {

plaid

A node.js client for the Plaid API

MIT
Latest version published 9 days ago

Package Health Score

89 / 100
Full package analysis

Popular plaid functions