https://github.com/pathikrit/node-joan
Thin nodejs client around the Joan API
https://github.com/pathikrit/node-joan
Last synced: over 1 year ago
JSON representation
Thin nodejs client around the Joan API
- Host: GitHub
- URL: https://github.com/pathikrit/node-joan
- Owner: pathikrit
- License: mit
- Created: 2023-01-23T15:30:50.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-27T15:20:55.000Z (over 3 years ago)
- Last Synced: 2025-03-01T09:40:22.456Z (over 1 year ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is a lightweight nodejs Promise based wrapper around the [Joan API](https://portal.getjoan.com/api/docs/)
## Installation [](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)
```