node package manager


harvest-er: Harvest Automation Server

NPM version Dependency Status code-style License NPM downloads

Getting Started

Harvester requires Node.js and npm, which can both be installed by following the instructions on Installing Node.js also installs npm.

Installing with npm

npm install harvest-er

Installing from source

git clone - clone the source code

npm install - install node dependencies

npm run debug - start the application using Supervisor with debug messages enabled


Start the application using Supervisor with npm run debug. The Harvest data will be downloaded and saved to Dropbox each time the server runs. To re-run this download, execute rs in Supervisor.

Setting up Harvest

  1. Add the admin users email/password to your environment

    export HARVESTER_SUBDOMAIN="thinkcrazy"
    export HARVESTER_ADMIN_TOKEN="abc-def-123-456"
  2. Set your Harvest subdomain in server/harvester.js and the email/password for the admin user:

    var harvester = new Harvest({
        subdomain: process.env.HARVESTER_SUBDOMAIN,  // your harvest subdomain 
        email: process.env.HARVESTER_ADMIN_EMAIL,
        password: process.env.HARVESTER_ADMIN_TOKEN

Getting Today's Expense and Time Entries data from Harvest (see app.js)

  1. Require harvest and harvester
const Harvest = require('harvest');
const Harvester = require('./harvester');
  1. Initialize Harvester and download the data using a promise array
function getTodaysData(){
  const harvest = new Harvest({
    subdomain: process.env.HARVESTER_SUBDOMAIN, 
    email: process.env.HARVEST_ADMIN_EMAIL,
    password: process.env.HARVEST_ADMIN_TOKEN
  const harvester = new Harvester(harvest);
  const tasks = [];

Future work

Setting up Dropbox

  1. Create a new Dropbox app at

    • Go to the settings for your new Dropbox app
    • Take note of the App key and App secret
    • Click "Generate" to get a Generated access token
  2. Add the admin users email/password to your environment

    export HARVESTER_DROPBOX_KEY=2abcdef1234t53e
    export HARVESTER_DROPBOX_SECRET=vn5aaf3bb5dd3qt
  3. Set your Dropbox credentials in server/dropboxer.js:

const client = new Dropbox.Client({
  key: process.env.HARVESTER_DROPBOX_KEY,
  secret: process.env.HARVESTER_DROPBOX_SECRET,
  token: process.env.HARVESTER_DROPBOX_TOKEN