# refocus-client

> REST API wrapper for Refocus

Latest version **1.2.0** (published 2018-09-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install refocus-client
pnpm add refocus-client
yarn add refocus-client
bun add refocus-client
```

## 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.0 |
| Published | 2018-09-20 |
| First published | 2016-11-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 173.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Ian Goldstein |
| Maintainers | ianmgoldstein |
| Keywords | Refocus, REST, API |

## Links

- npm: https://www.npmjs.com/package/refocus-client
- Repository: https://github.com/iamigo/refocus-client
- Homepage: https://github.com/iamigo/refocus-client#readme
- Issues: https://github.com/iamigo/refocus-client/issues
- npm.io page: https://npm.io/package/refocus-client

## Dependencies (4)

- [request](https://npm.io/package/request.md) ^2.76.0
- [global-tunnel](https://npm.io/package/global-tunnel.md) ^1.2.0
- [request-promise](https://npm.io/package/request-promise.md) ^4.1.1
- [promise-map-series](https://npm.io/package/promise-map-series.md) ^0.2.3

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2018-09-20
- 1.1.0 — 2018-01-30
- 1.0.25 — 2017-10-13
- 1.0.24 — 2017-04-08
- 1.0.23 — 2017-04-08
- 1.0.22 — 2017-03-22
- 1.0.21 — 2017-03-22
- 1.0.20 — 2017-03-22
- 1.0.19 — 2017-03-22
- 1.0.18 — 2017-03-21
- 1.0.17 — 2017-03-21
- 1.0.16 — 2017-02-09
- 1.0.15 — 2017-02-09
- 1.0.14 — 2017-02-04
- 1.0.13 — 2016-12-06
- … 13 more at https://npm.io/package/refocus-client/versions

## README

[![Coverage Status](https://coveralls.io/repos/github/iamigo/refocus-client/badge.svg)](https://coveralls.io/github/iamigo/refocus-client)

# refocus-client

Interact with the [Refocus](https://github.com/salesforce/refocus) API using `refocus-client` and Bluebird promises.

## Install

`npm install refocus-client --save`

## Usage

```
const RefocusClient = require('refocus-client');

// Some configuration
const refocusUrl = 'http://localhost:3000'; // The URL where Refocus is running
const apiVersion = 'v1'; // The Refocus API version
const token = 'skqjkbqkjnq9n34jn3jk3fjnwefwefwef34'; // Your API token

// Instantiate the RefocusClient.
const rc = new RefocusClient(refocusUrl, apiVersion, token);

// Now use the RefocusClient API. For example, here we create a new Aspect:
rc.addAspect({
  name: 'Latency',
  isPublished: true,
  timeout: '5m',
  valueType: 'NUMERIC',
  valueLabel: 'ms',
  criticalRange: [500, 999999999999],
  warningRange: [300, 500],
  infoRange: [200, 300],
  okRange: [0, 200],
})
.then((asp) => {
  // Do something else now that the aspect has been created?
  console.log(`Created "${asp.name}"`);
})
.catch((err) => {
  // Handle errors...
  console.log('Uh oh!', err);
});
```

## Proxy

If you need to specify a proxy for communication to Refocus, set environment variable "http_proxy".

## API

- [Aspects](docs/api/aspects.md)
- [GlobalConfig](docs/api/globalconfig.md)
- [Lenses](docs/api/lenses.md)
- [Perspectives](docs/api/perspectives.md)
- [Samples](docs/api/samples.md)
- [Subjects](docs/api/subjects.md)

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