# kubegrid-sdk-node

> Node.js library for the KubeGrid API https://api-docs.kubegrid.com/

Latest version **1.2.4** (published 2020-03-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install kubegrid-sdk-node
pnpm add kubegrid-sdk-node
yarn add kubegrid-sdk-node
bun add kubegrid-sdk-node
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2020-03-16 |
| First published | 2020-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^8.1 \|\| >=10.* |
| Dependencies | 3 |
| Unpacked size | 55.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | team@kubegrid.com |
| Maintainers | kubegrid |

## Links

- npm: https://www.npmjs.com/package/kubegrid-sdk-node
- Repository: https://github.com/kubegrid/kubegrid-sdk-node
- Homepage: https://api-docs.kubegrid.com/
- npm.io page: https://npm.io/package/kubegrid-sdk-node

## Dependencies (3)

- [qs](https://npm.io/package/qs.md) ^6.9.1
- [request](https://npm.io/package/request.md) ^2.88.0
- [eventsource](https://npm.io/package/eventsource.md) ^1.0.7

## Recent versions

- 1.2.4 (latest) — 2020-03-16
- 1.2.3 — 2020-03-09
- 1.2.2 — 2020-03-09
- 1.2.1 — 2020-03-02
- 1.2.0 — 2020-02-20
- 1.1.2 — 2020-02-10
- 1.1.1 — 2020-01-25
- 1.1.0 — 2020-01-25
- 1.0.1 — 2020-01-20
- 1.0.0 — 2020-01-20
- 0.0.9 — 2020-01-20
- 0.0.8 — 2020-01-15
- 0.0.7 — 2020-01-15
- 0.0.6 — 2020-01-10
- 0.0.5 — 2020-01-10
- … 4 more at https://npm.io/package/kubegrid-sdk-node/versions

## README

# KubeGrid Node.js Library

[![Version](https://img.shields.io/npm/v/kubegrid-sdk-node.svg)](https://www.npmjs.org/package/kubegrid-sdk-node)
[![Build Status](https://travis-ci.com/kubegrid/kubegrid-sdk-node.svg?branch=master)](https://travis-ci.org/kubegrid/kubegrid-sdk-node)
[![Coverage Status](https://coveralls.io/repos/github/kubegrid/kubegrid-sdk-node/badge.svg)](https://coveralls.io/github/kubegrid/kubegrid-sdk-node)
[![Downloads](https://img.shields.io/npm/dm/kubegrid-sdk-node.svg)](https://www.npmjs.com/package/kubegrid-sdk-node)

The KubeGrid library provides access to the KubeGrid API from application written in Node.js

## Documentation

See the `kubegrid-sdk-node` API Docs for Node.js at https://api-docs.kubegrid.com/

## Installation

Install the package with:

```
npm install kubegrid-sdk-node --save
# or
yarn add kubegrid-sdk-node
```

## Usage

The package needs to be configured with your account's API Key which is available in your KubeGrid dashboard https://manager.kubegrid.com

```
const kgApiKey = process.env.KG_API_KEY;

const kubegrid = require('kubegrid-sdk-node')(kgApiKey);

kubegrid.cluster.list().then(clusters => {
    console.log(clusters)
}).catch(err => {
    console.error(err)
})
```

Or using ES module and `async` / `await`

```
import KubeGrid from 'kubegrid-sdk-node'

const kubegrid = require('kubegrid')(kgApiKey);

(async() => {
    const clusters = await kubegrid.cluster.list()

    console.log(clusters)
})();

```

## KubeGrid on-premise integration

Just pass the `host` attribute when initializing kubegrid object:

```
const kgApiKey = process.env.KG_API_KEY;

const kubegrid = require('kubegrid-sdk-node')(kgApiKey, {
    host: 'api.yourhostname.com'
});

kubegrid.setProtocol('http');
kubegrid.setTimeout(20000);
```
Also don't forget to take the new API Key from your host instead of KubeGrid server.

## Development

Run all tests, please note you have to export your credentials by `export KG_TEST_API_KEY=<your-KubeGrid-API-key` first

```
yarn install
yarn test
```

If you don't have `yarn` installed, get it with `npm install --global yarn`

## License

Updating...

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