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

node-tide

v0.3.0

Published

A Node module to assist with connections to the Tide business banking API

Downloads

22

Readme

node-tide NPM version Build Status

A Node module to assist with connections to the Tide business banking API

Installation

$ npm install --save node-tide

Quick Usage Guide

Below is a quick guide to using the node-tide module, you can see full information in the documentation. There is also a quick example application available showing full integration with expressJs.

Getting the Authentication URL

You can easily get the URL required to authenticate against the Tide OAuth2 API.

Javascript

var nodeTide = require('node-tide');

// Create a new Tide application
var tide = new nodeTide.Tide();

// Generate the OAuth2 URL the user needs to authenticate
var authenticationUrl = nodeTide.auth.generateAuthUrl({
  applicationName: "Node Tide Application",
  redirectUrl: "https://mytideapp.com/tide/auth"
});

console.log(authenticationUrl);

Typescript

import { Tide, AuthenticationConfig } from "node-tide";

// Create a new Tide application
let tide = new Tide();

// Generate the OAuth2 URL the user needs to authenticate
let authenticationUrl: string = tide.auth.generateAuthUrl({
  applicationName: "Node Tide Application",
  redirectUrl: "https://mytideapp.com/tide/auth"
} as AuthenticationConfig);

console.log(authenticationUrl);

Pulling a list of companies

Once you have authenticated you can then pull a list of companies for the user.

Javascript

var nodeTide = require('node-tide');
var accessToken = "my4cc35570k3n"; // From authentication

// Create a new Tide application
var tide = new nodeTide.Tide(accessToken);

// Gets a list of companies
tide.companies.all()
  .then(function(companies) {
    for (var i = 0; i < companies.length; i++) {
      console.log(companies[i].name);
    }
  })

Typescript

import { Tide, Company } from "node-tide";
let accessToken: string = "my4cc35570k3n"; // From authentication

// Create a new Tide application
let tide = new Tide(accessToken);

// Gets a list of companies
this.companies.all()
  .then((companies: Company[]) => {
    companies.forEach((company: Company) => {
      console.log(company.name);
    })
  })

Pulling a list of accounts

Once you have a company ID you can then pull a list of accounts associated wtih a company.

Javascript

var nodeTide = require('node-tide');
var accessToken = "my4cc35570k3n"; // From authentication
var companyId = 182736; // From the company list

// Create a new Tide application
var tide = new nodeTide.Tide(accessToken);

// Gets a list of accounts
tide.accounts.all(companyId)
  .then(function(accounts) {
    for (var i = 0; i < accounts.length; i++) {
      console.log(accounts[i].name);
    }
  })

Typescript

import { Tide, Account } from "node-tide";
let accessToken: string = "my4cc35570k3n"; // From authentication
let companyId: number = 182736; // From the company list

// Create a new Tide application
let tide = new Tide(accessToken);

// Gets a list of accounts
this.accounts.all(companyId)
  .then((accounts: Account[]) => {
    accounts.forEach((account: Account) => {
      console.log(account.name);
    })
  })

Pulling a list of transactions

Once you have an account ID you can then pull a list of transactions from an account.

Javascript

var nodeTide = require('node-tide');
var accessToken = "my4cc35570k3n"; // From authentication
var accountId = 60192; // From the company list

// Create a new Tide application
var tide = new nodeTide.Tide(accessToken);

// Gets a list of accounts
tide.transactions.all(accountId)
  .then(function(transactions) {
    for (var i = 0; i < accounts.length; i++) {
      console.log(transactions[i].amount);
    }
  })

Typescript

import { Tide, Transaction } from "node-tide";
let accessToken: string = "my4cc35570k3n"; // From authentication
let accountId: number = 60192; // From the company list

// Create a new Tide application
let tide = new Tide(accessToken);

// Gets a list of accounts
this.transactions.all(accountId)
  .then((transactions: Transaction[]) => {
    transactions.forEach((transaction: Transaction) => {
      console.log(transaction.amount);
    })
  })

It is also possible to filter transactions by reference using this.transactions.findReference(accountId, 'My Reference') and also by date range using this.transactions.findDateRange(accountId, moment().subtract(2, 'days'))

License

MIT © Simon Skinner