sitegate-user

User microservice for SiteGate

Usage no npm install needed!

<script type="module">
  import sitegateUser from 'https://cdn.skypack.dev/sitegate-user';
</script>

README

sitegate-user

Dependency Status Build Status

Methods

getById(id, callback)

Usage

User.getById('550b42003376b4ec12fbbcb1', function(err, user) {
  console.log(user.name);
});

Arguments

Name Type Description
id string The ID of the user.
[options] object A hash with options.
Where
  • fields - {Array.<string>} - List of fields to be returned.
cb function(err, user) A callback function to receive the user.

update(id, updatedFields, [callback])

Usage

User.update('550b42003376b4ec12fbbcb1', {
  name: 'New name'
}, function (err, user) {
  console.log(user.name);
});

Arguments

Name Type Description
id string The ID of the user that has to be updated.
updatedFields object A hash of the fields that have to be updated with the new values.
cb function(err, user) A callback function to receive the updated user.

License

The MIT License (MIT)