I got this to work:
const ManagementClient = require('auth0').ManagementClient;
const auth0 = new ManagementClient({
domain: 'xxxx.auth0.com',
clientId: 'xxxx',
clientSecret:'xxxx',
scope: 'read:users update:users',
});
const GetUserDetails = async userId => {
console.log('userId', userId);
auth0
.getUser({ id: userId })
.then(function(users) {
console.log(users);
})
.catch(function(err) {
console.log(err);
});
};
const userId = 'auth0|xxxx';
GetUserDetails(userId);