StatsManager

management. StatsManager

Abstracts interaction with the stats endpoint.

Constructor

new StatsManager(options)

Source:
Parameters:
Name Type Description
options Object

The client options.

Name Type Attributes Description
baseUrl String

The URL of the API.

headers Object <optional>

Headers to be included in all requests.

retry Object <optional>

Retry Policy Config

Members

(inner) auth0RestClient :external:RestClient

Provides an abstraction layer for consuming the Stats endpoint.

Source:
Type:

Methods

getActiveUsersCount(cbopt) → {Promise|undefined}

Get a the active users count.

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

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.

Source:
Parameters:
Name Type Attributes Description
params Object

Stats parameters.

Name Type Description
from String

The first day in YYYYMMDD format.

to String

The last day in YYYYMMDD format.

cb function <optional>

Callback function.

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);
});