aurbano / robinhood-node

:chart_with_upwards_trend: NodeJS client for Robinhood Trading :fire:

Home Page:https://aurbano.github.io/robinhood-node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to instantiate?

nodesocket opened this issue · comments

The README.md shows:

rh = Robinhood(credentials);

Though seems like it should be:

Robinhood(credentials, function(error, broker) {
    if(error) {
        return callback(error);
    }

    callback(null, broker);
});

What is recommended?

Waiting for login worked for me.

var Robinhood = require('robinhood');

// Initialize
var trader = Robinhood(
    {
        username: 'user',
        password: 'password'
    },
    function() {
        trader.quote_data('GOOG', function(err, httpResponse, body){
            if (err) {
                console.error(err);
                return;
            }
            console.log('Quote data:', body);
        });
    }
);

published v0.1.0 that should fix this