Test sfdc connection
Last active
February 16, 2022 17:41
-
-
Save matt-newell/c78f5360712a41bb05a04c2a0e595557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const jsforce = require('jsforce'); | |
function main(){ | |
try { | |
var conn = new jsforce.Connection({ | |
loginUrl : 'https://test.salesforce.com' | |
}); | |
conn.login(process.env.username, process.env.password, function(err, userInfo) { | |
if (err) { return console.error(err); } | |
// Now you can get the access token and instance URL information. | |
// Save them to establish connection next time. | |
console.log(conn.accessToken); | |
console.log(conn.instanceUrl); | |
// logged in user property | |
console.log("User ID: " + userInfo.id); | |
console.log("Org ID: " + userInfo.organizationId); | |
// ... | |
}); | |
} catch(ex){ | |
console.log(ex) | |
} | |
} | |
console.log('bra') | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "sfdc-connect", | |
"version": "1.0.0", | |
"description": "Bulk v2 > sfdc", | |
"main": "index.js", | |
"bin": { | |
"sfdc-connect": "./index.js" | |
}, | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Matt Newell", | |
"license": "ISC", | |
"dependencies": { | |
"jsforce": "^1.11.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment