Can we use KiteTicker in NodeJS to receive Order placed of given accessToken

stripathix
Is it possible to use KiteTicker like below in the nodeJs Service? Or does this works only when used in a browser?

var KiteTicker = require("kiteconnect").KiteTicker;
var ticker = new KiteTicker({
api_key: "api_key",
access_token: "access_token"
});

Also, is it right that KiteTicker is notified for giver user access_token even if Order is executed from Kite Mobile App?
  • SRIJAN
    You can refer the NodeJS KiteTicker documentation here:
    https://github.com/zerodha/kiteconnectjs#getting-started-websocket-client

    Yes,you will be notified for every order,placed from either web/app/API if you use on_order_update.
  • stripathix
    @SRIJAN Thanks for the quick response :).

    So for example below logic will work
    const ticker = new KiteTicker({
    api_key,
    access_token,
    });
    ticker.connect();
    ticker.on('order_update', (odr) => {
    /**
    * This will recieve all order update of user associated by access_token
    */
    console.log('order_updated', odr);
    });
    ticker.on('connect', () => {
    console.log('TICKER CONNECTED');
    });
    I am not getting updates right now maybe because it's not trading hours? To test I tried to place a GTT order and then modify it, thought it might trigger order_updated?
  • SRIJAN
    For gtt orders,you will be updated when trigger is hit.
Sign In or Register to comment.