# galileo-agent

> Node Agent for Galileo (https://getgalileo.io)

Latest version **2.0.2** (published 2016-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install galileo-agent
pnpm add galileo-agent
yarn add galileo-agent
bun add galileo-agent
```

## 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 | 2.0.2 |
| Published | 2016-06-01 |
| First published | 2016-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Mashape Inc. |
| Maintainers | therebelrobot |
| Keywords | agent, analytics, api, har, http, https, mashape, galileo |

## Links

- npm: https://www.npmjs.com/package/galileo-agent
- Repository: https://github.com/mashape/galileo-agent-node
- Homepage: https://getgalileo.io
- Issues: https://github.com/Mashape/galileo-agent-node/issues
- npm.io page: https://npm.io/package/galileo-agent

## Dependencies (7)

- [uuid](https://npm.io/package/uuid.md) ^2.0.1
- [async](https://npm.io/package/async.md) ^1.2.1
- [xtend](https://npm.io/package/xtend.md) ^4.0.0
- [dotenv](https://npm.io/package/dotenv.md) ^1.2.0
- [unirest](https://npm.io/package/unirest.md) ^0.4.2
- [debug-log](https://npm.io/package/debug-log.md) ^1.0.0
- [stringify-clone](https://npm.io/package/stringify-clone.md) ^1.1.0

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2016-06-01
- 2.0.1 — 2016-06-01

## README

# Galileo Node Agent

Collect and send request records to Galileo for aggregation / logging

> for more information on Galileo, please visit [getgalileo.io](https://getgalileo.io)

## Installation

``` sh
npm install galileo-agent --save
```

## Usage

``` js
var express = require('express')
var galileo = require('galileo-agent')

var app = express()
var agent = galileo('SERVICE_TOKEN')

app.use(agent)

app.get('/api', function (req, res) {
  res.send('Hello World!')
})

app.listen()
```

## API

```js
var galileo = require('galileo-agent')
```

### galileo(serviceToken[, environment[, options]])

- **serviceToken**: `String` *(a Galileo Service Token)*
- **environment**: `String` *(a Galileo Environment Slug)*
- **options**: `Object` *(Agent Configuration [Options](#options))*

```js
galileo('SERVICE_TOKEN', 'PRODUCTION', {
  logBody: false,
  limits: {
    bodySize: 0
  },
  queue: {
    entries: 100
  },
  collector: {
    host: 'collector.galileo.mashape.com',
    port: 443,
    path: '/1.1.0/single',
    ssl: true
  }
})
```

### Options

| Name                 | Description                                                                      | Default |
| -------------------- | -------------------------------------------------------------------------------- | ------- |
| `logBody`            | send body of request/response with ALF record                                    | `false` |
| `queue.entries`      | num of entries per [ALF](https://github.com/Mashape/api-log-format) object       | `1000`   |
| `limits.bodySize`    | limit captured *request & response* body size in bytes                           | `10000`  |
| `collector.host`     | specify the collector hostname to which you send your data                       | `'collector.galileo.mashape.com'` |
| `collector.port`     | specify the port of the collector server (Galileo cloud requires SSL port: `443` | `443`   |
| `collector.path`     | specify the versioning path of the collector server                              | `'/1.1.0/single'` |
| `collector.ssl`      | specify if the collector server has ssl enabled (Galileo cloud requires `true`   | `true`  |

## Examples

- [HTTP](https://github.com/Mashape/galileo-agent-node/blob/master/examples/http.js)
- [Express.js](https://github.com/Mashape/galileo-agent-node/blob/master/examples/express.js)
- [Restify](https://github.com/Mashape/galileo-agent-node/blob/master/examples/restify.js)

## Copyright and license

Copyright Mashape Inc, 2016.

Licensed under [the MIT License](https://github.com/Mashape/galileo-agent-node/blob/master/LICENSE)

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