pc

piwik-client

Access a Piwik API from node.js

Showing:

Popularity

Downloads/wk

608

GitHub Stars

30

Maintenance

Last Commit

5yrs ago

Contributors

5

Package

Dependencies

0

Size (min+gzip)

0.5KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

nodejs-piwik

This a node.js module to access a Piwik API.

Installation

npm install piwik-client

Usage

var PiwikClient = require('piwik-client');
var myClient = new PiwikClient('https://example.tld/index.php', 'abcd1234' )

myClient.api({
  method:   'Actions.getPageUrls',
  idSite:   1,
  period:   'day',
  date:     'today'
}, function (err, responseObject) {
    //Code etc etc
});

new PiwikClient(baseUrl, [token]) - Returns a new PiwikClient

  • baseURL - required - The URL to your Piwik installation. Both HTTP and HTTPS are supported.
  • token - optional - Your API access token. Either set token or include token_auth in the baseURL.

PiwikClient#api({options}, callback) - Gets or sets data. Check out the Piwik API Reference for methods.

  • options.method - required - The method you want to call.
  • options.everything-else - optional - Dependent on the method your calling
  • callback - required - Will be called upon error or successful call, first arg is null unless there was an error, second contains parsed JSON response from piwik.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial