A NodeJS client for Lighthouse http://lighthouseapp.com
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
.travis.yml
README.md
index.js
package.json

README.md

lighthouse-client Build Status

A NodeJS client for Lighthouse

Installation

Install using npm: npm install lighthouse-client

Usage (high level api)

var lighthouse = require("lighthouse-client");

// For connecting to 'https://myaccount.lighthouseapp.com'
var account = lighthouse("myaccount", "my-token"); // http://help.lighthouseapp.com/kb/api/how-do-i-get-an-api-token
// or
var account = lighthouse("myaccount", {username: "me", password: "my-p@ssword"});

account.getProfile().then(function (profile) {
    console.log(profile.active_tickets);
});
account.getProjects().then(function(projects) {
    projects.forEach(function(project) {
        project.getTickets().then(function (tickets) {
            console.log(project.name);
            console.log(tickets);
        });
    });
});

See the API Documentation for more info.

Usage (low level api)

var Client = require("lighthouse-client").Client;
var lighthouseClient = new Client("myaccount", "mytoken");

// To fetch & parse: https://myaccount.lighthouseapp.com/projects/123/tickets.json
lighthouseClient.get('projects/123/tickets', {q: 'responsible:me'}).then(function(tickets) {
    tickets.forEach(function(ticket) {
        console.log(ticket.number, ticket.state);
    });
});

For more url and options: http://help.lighthouseapp.com/kb/api/