User Methods

Methods for accessing information about Armor Games users.

authenticateUser()

Returns information for the current user.

ag.authenticateUser().then(function(user) {
  // user (ArmorGamesUser object)
});

getUser(uid|username, isUsername)

Returns information for the specified user, either by UID or username.

ag.getUser(uid).then(function(user) {
  // user (ArmorGamesUser object)
});
ag.getUser(username, true).then(function(user) {
  // user (ArmorGamesUser object)
});

getFriends({ uid, limit, offset, page })

Returns an array of users who are connected to the specified user.

ag.getFriends({
  uid: ...,
  limit: ...,
  offset: ...,
  page:...
}).then(function(users) {
  // users (array of ArmorGamesUser objects)
});