0.0.3 • Published 5 years ago

agent-stats v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

agent-stats

Fetch stats from the agent-stats.com API.

See api-docs for response details.

Requires nodejs 8.x

Usage

Install

npm i agent-stats

Initialize.

const AgentStats = require('agent-stats');
var agentStats = new AgentStats(apikey);

Change api-key or api-base-uri.

agentStats.apiKey = 'new-key';
agentStats.apiBase = 'https://example.com/agentstats';

Example: Retrieve groups associated with API-key's user

agentStats.getGroups().then(function (result) {
	console.log(result);
}).catch((err) => {
	console.error(err);
});

Available methods. Each method returns a promise.

ReturnsMethodAPI call
PromisegetGroups()#api-Groups-listGroups
PromisegetPending(group_id)#api-Groups-getPendingUsers
PromisegetGroupProgress(group_id, type?)#api-Groups-showGroup
PromisegetShares()#api-Medals-share
PromisegetShare(username, startdate?)#api-Medals-sharedProgress
PromiserequestGroupRefresh(group_id)#api-Groups-requestRefresh
PromisegetMedals()#api-Medals-medals
PromisegetProgress(startdate?)#api-Medals-progress
0.0.3

5 years ago

0.0.2

6 years ago

0.0.1

7 years ago