lighthouse-client

0.5.0 • Public • Published

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/

Dependencies (2)

Dev Dependencies (1)

Package Sidebar

Install

npm i lighthouse-client

Weekly Downloads

209

Version

0.5.0

License

BSD

Last publish

Collaborators

  • jbuck
  • bfanger