@kavita-0
let web_socket = new WebSocketV2({
jwttoken: 'JWT_TOKEN',
apikey: 'API_KEY',
clientcode: 'Client_code',
feedtype: 'FEED_TYPE',
});
// for mode, action and exchangeTypes , can use values from constants file.
web_socket.connect().then((res) => {
let json_req = {
correlationID: 'correlation_id',
action: 1,
mode : 1,
exchangeType: 1,
tokens: ["123"],
};
web_socket.fetchData(json_req);
web_socket.on('tick', receiveTick);
function receiveTick(data) {
console.log('receiveTick:::::', data);
}
});
Try this official sample code mentioned in the README.md of https://github.com/angel-one/smartapi-javascript