npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yodlee-wrapper

v4.0.0

Published

Yodlee API wrapper for Node (forked from craigrich/yodlee).

Downloads

3

Readme

NPM version Build Status Coverage Status Dependency Status

Yodlee API wrapper for node. Forked from Craig Richardson's original repository: https://github.com/craigrich/yodlee

Installation

$ npm install --save yodlee

Usage

var yodlee = require('yodlee');

Authentication using Cobrand Credentials & User Login

Yodlee requires a cobSessionToken before we can access the API. Get your credentials here. You can specify whether you wish to use the Sandbox API or the Live API when setting the Cobrand Credentials.

Yodlee uses the standard oauth authentication flow in order to allow apps to act on a user's behalf. Perform a login request to use the Yodlee API on behalf of a specific user after the Cobrand login step completes.

yodlee.use({
    username: 'sbCobExampleAdminUser',
    password: '96d621ec-2323-4664-b2fa-17ba6796b116',
    sandbox: true
}).then(function() {
  
  yodlee.login({
    username: 'app.user',
    password: 'password@123#'
  }).then(function(login) {
    // Access the tokens via the login object passed to this function
  }).catch(function(error) {});
  
}).catch(function(error) {});

Accessing authentication tokens

The authentication tokens are cached in the application memory for 20 minutes after authentication by the steps above. The tokens should be accessed by the helper methods below. These methods will determine whether or not a new token is required based on the expiration timestamp stored in memory.

After performing a login you can access the session tokens using the helper methods below.

yodlee.getCobSessionToken().then(function(cobSessionToken) {
  // The cobSessionToken is returned as a String
}).catch(function(error) {}); 
yodlee.getUserSessionToken({
  username: 'app.user',
  password: 'password@123#'
}).then(function(userSessionToken) {
  // The userSessionToken is returned as a String
}).catch(function(error) {}); 
yodlee.getBothSessionTokens({
  username: 'app.user',
  password: 'password@123#'
}).then(function(tokens) {
  // The tokens are returned in an Object
  // tokens.cobSessionToken
  // tokens.userSessionToken
}).catch(function(error) {}); 

Note: When calling getBothSessionTokens & getUserSessionToken the method will only require the username and password for the user if a new userSessionToken is required. This is because a new login request will be performed against the Yodlee API.

Using the API

Once a user has successfully authenticated against the API the following methods can be used. Each method will determine which access tokens are required and only go to the Yodlee Auth API for new tokens when they have expired. Therefore, in most scenarios, a simple call to use and login methods is required and the Yodlee Node library will take care of all other authentication decisions. The helper methods for access tokens above are only really useful if you wish to perform your own caching of the tokens in your application and need to access them for persistence purposes, or something similar.

GET All Site Accounts

Returns the information related to the specified accounts aggregated by the User: Yodlee Docs

yodlee.getAllSiteAccounts().then(function(accounts) {
  // The JSON response from the Yodlee API is passed into this function (see link above for details)
}).catch(function(error) {}); 

GET Execute User Search

Executes a transaction search and returns the first page result: Yodlee Docs

yodlee.executeUserSearch({
  containerType: 'All',
  higherFetchLimit: 500,
  lowerFetchLimit: 1,
  resultRangeEndNumber: 60,
  resultRangeStartNumber: 1,
  searchFilterCurrencyCode: 'GBP',
  ignoreUserInput: true
}).then(function(transactions) {
  // The JSON response from the Yodlee API is passed into this function (see link above for details)
}).catch(function(error) {}); 

GET Site Login Form

Returns the login form structure for a given Yodlee Site ID: Yodlee Docs

yodlee.getSiteLoginForm({
  siteId: 3970
}).then(function(loginForm) {
  // The JSON response from the Yodlee API is passed into this function (see link above for details)
}).catch(function(error) {}); 

Contributing

Unit tests

Unit test are written in Mocha. Please add a unit test for every new feature or bug fix. npm test to run the test suite.

Documentation

Add documentation for every API change. Feel free to send corrections or better docs!

Pull Requests

Send fixes PR on the master branch.

License

MIT © Craig Richardson