Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kametventures/metrics

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kametventures/metrics

## Install

  • 0.1.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Metrics JavaScript client

Install

npm install --save @kametventures/metrics

Configure

import { createClient } from '@kametventures/metrics/client/factory';

const client = createClient({
    token: 'ez1234...'
});

See the reference for all the configuration options.

Plug into your framework

Koa

Collecting metrics
import collectorFactory from '@kametventures/metrics/koa/collector';

app.use(collectorFactory(client));

You can use the 2nd argument to give a set of options:

app.use(collectorFactory(client, options))

The supported options are:

  1. additionalAttributes.
    A function that returns a key-value pair of additional attributes to be sent.
Exposing your routes

When using koa-router

import Router from 'koa-router';
import routesFactory from '@kametventures/metrics/koa/routes';

const router = new Router();

// You register all your routes...

app.use(routesFactory(router));

References

Configuration options

NameDescriptionRequired
tokenYour authentication token to the collection APIYes
apiBaseUrlBase URL used for the API.No
globalAttributesList of attributes to be added to every sent event.

Example: {user: 'username', release: 'something'}

FAQs

Package last updated on 13 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc