# node-joan

> Thin nodejs client around the Joan API

Latest version **0.0.3** (published 2023-01-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-joan
pnpm add node-joan
yarn add node-joan
bun add node-joan
```

## 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.3 |
| Published | 2023-01-27 |
| First published | 2023-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pathikrit Bhowmick |
| Maintainers | pathikrit |
| Keywords | visionect, joan |

## Links

- npm: https://www.npmjs.com/package/node-joan
- Repository: https://github.com/pathikrit/node-joan
- Issues: https://github.com/pathikrit/node-joan/issues
- npm.io page: https://npm.io/package/node-joan

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^1.2.3
- [simple-oauth2](https://npm.io/package/simple-oauth2.md) ^5.0.0

## Recent versions

- 0.0.3 (latest) — 2023-01-27
- 0.0.2 — 2023-01-24
- 0.0.1 — 2023-01-23

## README

This is a lightweight nodejs Promise based wrapper around the [Joan API](https://portal.getjoan.com/api/docs/)

## Installation [![NPM Package Version](https://img.shields.io/npm/v/node-joan.svg?)](https://www.npmjs.com/package/node-joan)
```sh
npm add node-joan
```

## Example
```js
const {JoanAPIClient} = require('node-joan');

const joan = new JoanAPIClient('client_id', 'client_secret')

joan.devices().then(res => console.log(res))

joan.book({
  source: "conf_room_one.calendar.google.com",
  start: "2019-11-05T13:00:00-05:00",
  end: "2019-11-05T14:00:00-05:00",
})
.then(res => console.log(res))
.catch(err => console.error(err))

joan.accessToken().then(token => console.log(token))
```

## APIs
```js
joan.accessToken()
joan.me()
joan.devices()
joan.users()

// Rooms APIs
joan.rooms.get()
joan.rooms.get(id)
joan.rooms.post(data)
joan.rooms.put(id, data)
joan.rooms.patch(id, data)
joan.rooms.delete(id, data)
joan.rooms.book(data)

// Events APIs
joan.events.cancel(data)
joan.events.checkin(data)
joan.events.extend(data)
joan.events.move(data)
joan.events.book(data)
joan.events.invite(data)
joan.events.confirm(data)
joan.events.reject(data)
```

### Primitive APIs
Directly call any HTTP endpoints using the following low level utils:
```js
joan.get(path)
joan.post(path, data)
joan.put(path, data)
joan.patch(path, data)
joan.delete(path, data)
joan.options(path)
```

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