It looks like you're new here. If you want to get involved, click one of these buttons!
import { KiteTicker } from 'kiteconnect';
import { KiteConnect } from 'kiteconnect';
const requestToken = ' '
const apiSecret = '';
const apiKey = '';
const accessToken
let kc = new KiteConnect({
api_key: apiKey
});
kc.generateSession(requestToken, apiSecret).then(session => {
access_token = session.access_token;
}).catch(err => {
console.log(err)
});
let ticker = new KiteTicker({
api_key: apiKey,
access_token: accessToken
});
ticker.autoReconnect(true, 10, 5);
ticker.connect();
ticker.on("ticks", onTicks);
ticker.on("connect", subscribe);
function onTicks(ticks) {
console.log("Ticks", ticks);
}
function subscribe() {
var items = [738561];
ticker.subscribe(items);
ticker.setMode(ticker.modeFull, items);
}
import { KiteTicker } from 'kiteconnect';
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
The getting started with API Code Documentation on the Github Nodejs Client doesn't work as well, I have tried getting that to work.