There seems to issue with smartapi-javascript nodejs sdk.. In file smartapi-connect.js, generateToken method,
there is issue with setting public token statement. Current statement,
self.setPublicToken(token_data.data.refreshToken);
This should be,
self.setPublicToken(response.data.refreshToken);