Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

Add a system of "addons" to connect trackers #11

Closed
SamyPesse opened this issue Oct 7, 2013 · 1 comment
Closed

Add a system of "addons" to connect trackers #11

SamyPesse opened this issue Oct 7, 2013 · 1 comment

Comments

@SamyPesse
Copy link
Member

The idea is to simplify the implementation in the backend of new trackers that the users can add in one click.

Goals:

  • Addons are JS modules (can be added with npm or in the code base)
  • Should be configurable from config.js
  • Tracker should have access to a great API to manage "crons", oauth, ...

How a user can add trackers to his reportr instance ?

/* Trackers */
"trackers": [
    {
        'module': 'module_name', // inside the trackers directory or installed using npm
        'config': {
            /* Base configuration for the service : api keys, ... */
        }
    }
]

Code base for a tracker

module.exports = {
    name: "My Tracker",
    description: "My incredible tracker",
    icon: "http://...",

    setup: function(tracker) {
        /* Call with a tracker object at the server initialization */
    },
}

API for trackers

tracker.config // Config object
tracker.addCron(function(user) { }, delay) // Add a cron to indexe events for users
@SamyPesse
Copy link
Member Author

Started : ex of ping trackers : https://github.com/SamyPesse/reportr/blob/master/lib/trackers/ping.js

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant