StatsManager

management. StatsManager

Abstracts interaction with the stats endpoint.

Constructor

new StatsManager(options)

Parameters:
Name Type Description
options Object The client options.
Properties
Name Type Attributes Description
baseUrl String The URL of the API.
headers Object <optional>
Headers to be included in all requests.
Source:

Members

stats :external:RestClient

Provides an abstraction layer for consuming the Stats endpoint.
Type:
Source:

Methods

getActiveUsersCount(cbopt) → {Promise|undefined}

Get a the active users count.
Parameters:
Name Type Attributes Description
cb function <optional>
Callback function.
Source:
Returns:
Type
Promise | undefined
Example
management.stats.getActiveUsersCount(function (err, usersCount) {
  if (err) {
    // Handle error.
  }

  console.log(usersCount);
});

getDaily(params, cbopt) → {Promise|undefined}

Get the daily stats.
Parameters:
Name Type Attributes Description
params Object Stats parameters.
Properties
Name Type Description
from String The first day in YYYYMMDD format.
to String The last day in YYYYMMDD format.
cb function <optional>
Callback function.
Source:
Returns:
Type
Promise | undefined
Example
var params = {
  from: '{YYYYMMDD}',  // First day included in the stats.
  to: '{YYYYMMDD}'  // Last day included in the stats.
};

management.stats.getDaily(params, function (err, stats) {
  if (err) {
    // Handle error.
  }

  console.log(stats);
});