# clubhouse-lib

> A Promise based library to the Shortcut REST API

Latest version **0.13.0** (published 2021-09-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install clubhouse-lib
pnpm add clubhouse-lib
yarn add clubhouse-lib
bun add clubhouse-lib
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.13.0 |
| Published | 2021-09-20 |
| First published | 2016-05-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 42.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 142 |
| Maintainers | clubhouse, andrewchilds, iwillig, benjaminwittenberg, charpeni, maryjenel, zacharyozer |

## Links

- npm: https://www.npmjs.com/package/clubhouse-lib
- Repository: https://github.com/useshortcut/clubhouse-lib
- Issues: https://github.com/useshortcut/clubhouse-lib/issues
- npm.io page: https://npm.io/package/clubhouse-lib

## Dependencies (2)

- [cross-fetch](https://npm.io/package/cross-fetch.md) ^3.1.4
- [universal-url](https://npm.io/package/universal-url.md) ^2.0.0

## Recent versions

- 0.13.0 (latest) — 2021-09-20
- 0.11.0-rc.0 (next) — 2021-03-01
- 0.9.0-rc.4 (rc) — 2019-11-05
- 0.12.0 — 2021-03-03
- 0.11.0 — 2021-03-01
- 0.10.0 — 2020-01-22
- 0.9.0 — 2019-11-05
- 0.9.0-rc.3 — 2019-11-05
- 0.9.0-rc.2 — 2019-11-04
- 0.9.0-rc.1 — 2019-11-04
- 0.9.0-rc.0 — 2019-10-29
- 0.8.0 — 2019-08-23
- 0.7.0 — 2019-07-17
- 0.6.1 — 2019-07-08
- 0.6.0 — 2019-04-25
- … 17 more at https://npm.io/package/clubhouse-lib/versions

## README

<p align="center">
  <img height="60" src="https://user-images.githubusercontent.com/7189823/67512945-deb55180-f667-11e9-823f-023d1629f868.png" alt="Clubhouse logo">
</p>

<h3 align="center">
  Clubhouse-lib
</h3>

<p align="center">
  A library for interacting with the Shortcut REST API
</p>

<p align="center">
  <a href="https://www.npmjs.org/package/clubhouse-lib">
    <img src="https://badge.fury.io/js/clubhouse-lib.svg" alt="Current npm package version." />
  </a>
  <a href="https://circleci.com/gh/useshortcut/clubhouse-lib">
    <img src="https://circleci.com/gh/useshortcut/clubhouse-lib.svg?style=shield" alt="Current CircleCI build status." />
  </a>
  <a href="https://circleci.com/gh/useshortcut/clubhouse-lib">
    <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
  </a>
  <a href="https://twitter.com/intent/follow?screen_name=useshortcut">
    <img src="https://img.shields.io/twitter/follow/useshortcut.svg?label=Follow%20@useshortcut" alt="Follow @useshortcut" />
  </a>
</p>

<br>

## Getting Started

### Installation

You can install clubhouse-lib with [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com).

```shell
npm install --save clubhouse-lib
```

or

```shell
yarn add clubhouse-lib
```

### How to Get an API Token

The Shortcut API uses token-based authentication, you will need one to use this library.

To generate an API token, go to https://app.shortcut.com/settings/account/api-tokens. To make it easier to explore our API, we recommend saving this token as an environment variable in your local dev environment:

```bash
export SHORTCUT_API_TOKEN="YOUR API TOKEN HERE"
```

This will allow you to copy and paste many examples in the documentation to try them out.

Requests made with a missing or invalid token will get a `401 Unauthorized` response. All requests must be made over HTTPS. Tokens provide complete access to your Shortcut account, **so keep them secure**. Don’t paste them into your source code, use an environment variable instead. For security reasons, we will immediately invalidate any tokens we find have been made public.

## Usage

```javascript
import Shortcut from 'clubhouse-lib';

const client = Shortcut.create('your token value'); // See https://github.com/useshortcut/clubhouse-lib#how-to-get-an-api-token

client.listMembers().then(console.log);

client.getMember('')
  .catch(x => console.error(x.body))
  .then(console.log);

client.listProjects().then(console.log);
```

## Play with It

You can play with it in your web browser with this live playground: 

- [CodeSandbox](https://codesandbox.io/s/clubhouse-lib-playground-r447i)

## Documentation

[Documentation for the REST API](https://shortcut.com/api/rest).

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