0.0.1-alpha.4 • Published 8 years ago

activecollab.js v0.0.1-alpha.4

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

ActiveCollab.js

Just a Node.js module that makes communication with Active Collab API easy.

NOTE This module is still in development and the structure can be changed anytime. I do not recommend using this module in production.

Installation

Node

Run npm install activecollab.js --save to install and save the module.

Browser

ActiveCollab.js doesn't support browsers yet. This will be added in the feature

Example

const ActiveCollab = require('activecollab.js');
const client = new ActiveCollab.Client('<NAME>', '<VENDOR>');

client.login('<EMAIL>', '<PASSWORD>')
    .then(() => {
        if (client.accounts.empty()) {
            throw 'There are no accounts in bounded to this user.';
        }

        return client.accounts.first().issueToken();
    })
    .then((account) => account.projects())
    .then((projects) => console.log(`I am in ${projects.size()} project(s)! The names are: ${projects.map((project) => project.name).join(', ')}`))
    .catch((e) => console.log('Failed to load the example: ', e));

Links