Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var KiteConnect = require("kiteconnect").KiteConnect;
var api_key = "api_key",
secret = "api_secret",
request_token = "request_token",
access_token = "";
var options = {
"api_key": api_key,
"debug": false
};
kc = new KiteConnect(options);
kc.setSessionExpiryHook(sessionHook);
if(!access_token) {
kc.generateSession(request_token, secret)
.then(function(response) {
console.log("Response", response);
init();
})
.catch(function(err) {
console.log(err);
})
} else {
kc.setAccessToken(access_token);
init();
}