Metrics

Represents an interface for metrics-related functionalities. Provides methods to retrieve metrics, log events, and handle event-based interactions.

Methods

(static) getDaysSinceRegistration(timestampopt) → {number}

Calculates the number of days that have passed since the user's registration. If the timestamp parameter is not provided, the current date and time (Date.now()) is used.

Parameters:
NameTypeAttributesDefaultDescription
timestampnumber<optional>
Date.now()

The optional timestamp to calculate the difference from the registration time.

Returns:

The number of days since registration.

Type: 
number

(static) logEvent(name, params)

Logs an event with the specified name and parameters.

Parameters:
NameTypeDescription
namestring

The name of the event to be logged.

paramsObject

An object containing parameters associated with the event.

(static) on(eventName, callback)

Attaches a listener for the specified event and executes the callback function when the event is triggered.

Parameters:
NameTypeDescription
eventNamestring

The name of the event to listen for.

callbackfunction

The callback function to execute when the event is triggered.