JSPM

kred

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q36452F
  • License MIT

Kred API client for Node.js

Package Exports

  • kred

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kred) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Kred API client for Node.js

This library allows you to easily access all API endpoints for Kred. Refer to the Kred API documentation for more details.

Requirements

Request a free API key at https://developer.peoplebrowsr.com/signup

Usage

Use your app id and app key to create a Kred instance

var Kred = require('kred');
var kred = new Kred(APP_ID, APP_KEY);

Default configuration can be overriden by providing a config object

var kred = new Kred(APP_ID, APP_KEY, {
    protocol: 'http',
    host: 'api.kred.com',
    port: 80
});

Call any of the available API methods kredscore, kred, kredentials, dailyscore, dailypoints, activityStream, friendStream, kredinfluence, kredoutreach, kredretweetinfluence with a parameters object and a callback function

var parameters = {source: 'twitter', term: 'dirkbonhomme'};
kred.kredscore(parameters, function(error, results){
    if(error){
        console.log('Something went wrong', error);
    }else{
        console.log('Results', results);
    }
});

or call new/unsupported API endpoints

kred.request('kredscore', parameters, callback);

Developing

The library is published to NPM and can be installed with the following command:

$ npm install kred

Testing

Navigate to this module's repository and make sure you have the development modules installed:

$ npm install

Run the tests:

$ npm test