This module provides a simple Anko Investor Forecasts gRPC Service client for NodeJS.
This client does little more than wrap @grpc/grpc-js
, the latest protobuf definition for accessing Forecasts, and handling auth.
$ npm i --save "@anglo-korean/anko-node-sdk"
Given a valid token from https://anko-investor.com (see: Getting Started for more information), the following example will start consuming Forecasts
const hostname = require("os").hostname();
const anko = require('@anglo-korean/anko-node-sdk);
const conn = new anko.Connection(process.env.ANKO_TOKEN, hostname);
conn.handle( (forecast) => {
console.log(forecast);
});
(Here we use the current machine's hostname as a client identifier- this can be anything, really; it's useful to set in case you need to open a support ticket to help debug connections. It can even be an empty string).