# pivotal-api

> Pivotal API

Latest version **0.0.8** (published 2016-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install pivotal-api
pnpm add pivotal-api
yarn add pivotal-api
bun add pivotal-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2016-04-25 |
| First published | 2016-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | George |
| Maintainers | g3org3 |

## Links

- npm: https://www.npmjs.com/package/pivotal-api
- Repository: https://bitbucket.org/xik/pivotal-api
- Homepage: https://bitbucket.org/xik/pivotal-api#readme
- npm.io page: https://npm.io/package/pivotal-api

## Dependencies (4)

- [q](https://npm.io/package/q.md) ^1.4.1
- [purdy](https://npm.io/package/purdy.md) ^1.6.0
- [lodash](https://npm.io/package/lodash.md) ^4.6.1
- [needle](https://npm.io/package/needle.md) ^1.0.0

## Recent versions

- 0.0.8 (latest) — 2016-04-25
- 0.0.7 — 2016-04-24
- 0.0.6 — 2016-04-24
- 0.0.5 — 2016-04-24
- 0.0.4 — 2016-04-24
- 0.0.3 — 2016-04-01
- 0.0.2 — 2016-03-19

## README

## Pivotal-Tracker Api Module.

Interact with pivotal-tracker's api

## Add it to your project
```sh
$ npm i --save https://github.com/g3org3/pivotal-api
```

```javascript
  // Dependency
  const PivotalApi = require('pivotal-api')

  // User Token
  const Api = new PivotalApi(process.env.PIVOTAL_TOKEN)
```

## Api

+ getMyinfo
+ getProjects
+ getAccounts
+ getAccountMembership

## Get my info
```javascript
  Api.getMyinfo((err, myInfo) => {
    if (err) console.log(err);
    else console.log(myInfo.name);
  });

  // Or if you like promises
  Api.getMyinfo()
  .then(res => console.log(res.name) )
  .fail(err => console.log(err) );
```

## Get Projects
```javascript
  Api.getProjects((err, projects) => {
    if (err) console.log(err);
    else console.log(projects);
  });

  // Or if you like promises
  Api.getMyinfo()
  .then(res => console.log(res) )
  .fail(err => console.log(err) );
```

## Get Accounts
```javascript
  Api.getAccounts((err, accounts) => {
    if (err) console.log(err);
    else console.log(projects);
  });

  // Or if you like promises
  Api.getAccounts()
  .then(res => console.log(res) )
  .fail(err => console.log(err) );
```

## Get Account's Memberships
```javascript
  Api.getAccountMemberships(account_id, (err, memberships) => {
    if (err) console.log(err);
    else console.log(memberships);
  });

  // Or if you like promises
  Api.getAccountMemberships(account_id)
  .then(res => console.log(res) )
  .fail(err => console.log(err) );
```

## Get Accounts' Memberships
```javascript
  // array of accounts with { id }
  // you could use the getAccounts response 
  // just with promises
  Api.getAccountsMemberships(accounts)
  .then(res => console.log(res) )
  .fail(err => console.log(err) );
```

---
_Source: https://npm.io/package/pivotal-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
