@bhumi ,I'm talking about Kite Connect API Javascript client version, it should be latest, version 3. You can check version of kiteconnect JS client by npm list --depth=0, it should be [email protected], if not ,then try installing latest version by npm install kiteconnect@beta.
And probably it will help you
var KiteTicker = require("kiteconnect").KiteTicker;
var ticker = new KiteTicker({
api_key: "api_key",
access_token: "access_token"
});
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);
}
How can I make successful connection with this?
Make sure you are on latest Kite connect client.
https://gist.github.com/ajinasokan/b36d17da1a58af62782978c16bca309a
Is this old code? If yes then kindly provide the latest code.
You can check version of kiteconnect JS client by
npm list --depth=0
, it should be[email protected]
, if not ,then try installing latest version bynpm install kiteconnect@beta
.