Package Exports
- @chg/salesforce-users
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chg/salesforce-users) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Salesforce-Users
This module contains methods used when interacting with salesforce users. There are a number of methods that can be used to retrieve details about a user and a utility method for setting properties of those users.
Usage
npm i @chg/salesforce-users
const sfUsers = require('@chg/salesforce-users')('client_id', 'client_secret', 'dev');
// make sure the user you use has access to change user and contact records in salesforce
sf.authorize('admin_user', 'shhh secret password!');
// Get/Set user
const user = await sf.getUser('MrTumnus@yahoo.com');
await sf.setUser('MrTumnus@yahoo.com', { FavoriteFood: "Turkish Delight" });
// Get/Set contact
const contact = await sf.getContact('MrTumnus@yahoo.com');
await sf.setContact('MrTumnus@yahoo.com', { FavoriteFood: "Turkish Delight" });
// We are ready to delete Mr. Tumnus
await sf.deactivateUser("MrTumnus@yahoo.com");