# node-scalingo

> Node client for Scalingo API

Latest version **0.3.0** (published 2020-02-04) · AGPL-3.0 license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2020-02-04 |
| First published | 2020-02-03 |
| Weekly downloads | 0 |
| License | AGPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 75.7 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jérémy Buget |
| Maintainers | jbuget |
| Keywords | Scalingo, Node |

## Links

- npm: https://www.npmjs.com/package/node-scalingo
- Repository: https://github.com/jbuget/node-scalingo
- Homepage: https://github.com/jbuget/node-scalingo#readme
- Issues: https://github.com/jbuget/node-scalingo/issues
- npm.io page: https://npm.io/package/node-scalingo

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.19.2
- [moment](https://npm.io/package/moment.md) ^2.24.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2020-02-04
- 0.2.0 — 2020-02-04
- 0.1.6 — 2020-02-04
- 0.1.5 — 2020-02-04
- 0.1.4 — 2020-02-04
- 0.1.3 — 2020-02-03
- 0.1.2 — 2020-02-03
- 0.1.1 — 2020-02-03

## README

# node-scalingo

This library is an out-of-the-box HTTP client for the [Scalingo](https://scalingo.com/) API in Node.js.

You can find the detailed Scalingo API specifications on [the official API documentation website](https://developers.scalingo.com/).

## Getting started

**1/** Get the following information from Scalingo:
- **api_token**: from [your account](https://my.scalingo.com/profile) or the Scalingo CLI, generate or get your Scalingo API token
- **api_endpoint**: from [the API documentation site](https://developers.scalingo.com/), get your targeted region endpoint:
    - Agora: https://api.agora-fr1.scalingo.com/v1
    - Outscale: https://api.osc-fr1.scalingo.com/v1

**2/** Install the dependency

```
npm install node-scalingo --save
```

**3/** In your code, define a new `ScalingoApi` object. Then use the services you need.

```javascript
const { ScalingoApi } = require('node-scalingo');

const API_TOKEN = '<your_api_token>'; // Enter your own API token
const API_ENDPOINT = 'https://api.osc-fr1.scalingo.com/v1';  // ex: for Outscale region

const scalingoApi = new ScalingoApi(API_TOKEN, API_ENDPOINT);

scalingoApi.apps.listApplications().then(console.log);
```

## Usage

It is recommended to consume services through `ScalingoApi`.

If you miss a service - this library is still in construction (feb. 2020) -, you can still use `ScalingoClient` and the `query()` method, according to the [Scalingo developers documentation](https://developers.scalingo.com/).

The following example do the same as previously, but with `ScalingoClient` instead of `ScalingoApi`.

```javascript
const { ScalingoClient } = require('node-scalingo');

const API_TOKEN = '<your_api_token>'; // Enter your own API token
const API_ENDPOINT = 'https://api.osc-fr1.scalingo.com/v1';  // ex: for Outscale region

const scalingoClient = new ScalingoClient(API_TOKEN, API_ENDPOINT);

scalingoClient.query('apps', 'get').then((response) => console.log(response.data));
```

## Documentation

Please refer to the [Scalingo API guides](https://developers.scalingo.com/) for help using `node-scalingo`.

## Contributing

### Installation

```
git clone git@github.com:jbuget/node-scalingo.git
cd node-scalingo
npm install
npm run build
npm test
```

### Publishing

```
npm run release
```

## License

This project is licensed under the [AGPL-3.0 License](https://github.com/jbuget/node-scalingo/blob/master/LICENSE).

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