Reputation: 9559
I am using the JSForce docs in order to create a Javascript app to connect to my Salesforce org. My code is as follows:
var jsforce = require('jsforce');
var conn = new jsforce.Connection({
loginUrl : 'https://test.salesforce.com'
});
var username = '[email protected]';
var password = 'mypassword';
conn.login(username, password, function(err, userInfo) {
if (err) { return console.error(err); }
console.log(conn.accessToken);
console.log(conn.instanceUrl);
console.log("User ID: " + userInfo.id);
console.log("Org ID: " + userInfo.organizationId);
});
However, when I run it, it appears to do nothing at all. I would expact to see either the access token etc to be logged to indicate success, or an error to indicate failure. But nothing is logged at all.
When I check the login history on my Salesforce org, I can see the attempts, they are successful.
What's going on?
Upvotes: 1
Views: 1116
Reputation: 9559
The answer is simple. The instructions are for jsforce v1.x, but I had jsforce 2.x (beta). Fixed by doing this:
npm install [email protected]
Upvotes: 0