Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

readmeio

3.0.0 • Public • Published

readmeio

Track your API metrics within ReadMe.

Build

Installation

npm install readmeio

Usage

Just add the middleware to express, and that's it!

const readme = require('readmeio');
 
app.use(readme.metrics('<<apiKey>>', req => ({
  id: req.project._id,
  label: req.project.name,
  email: req.project.owner
})));

View full documentation here: https://docs.readme.com/docs/sending-logs-to-readme-with-nodejs

Limitations

  • Currently only supports JSON request bodies. Adding a whitelist/blacklist for non-JSON bodies will not work (unless they're added to req.body) the same way that body-parser does it. The properties will be passed into postData as a params array.
  • Needs more support for getting URLs when behind a reverse proxy: x-forwarded-for, x-forwarded-proto, etc.
  • Needs more support for getting client IP address when behind a reverse proxy.
  • Logs are "fire and forget" to the metrics server, so any failed requests (even for incorrect API key!) will currently fail silently.

Credits

Dom Harrington Marc Cuva

License

ISC

Keywords

none

Install

npm i readmeio

DownloadsWeekly Downloads

1,075

Version

3.0.0

License

ISC

Unpacked Size

36.6 kB

Total Files

18

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar