Skip to content

A tiny middleware to send errors to trackjs from zeit's micro framework

License

Notifications You must be signed in to change notification settings

tiagogm/micro-trackjs

Repository files navigation

micro-trackjs

micro-trackjs allows you to send micro errors to TrackJS.

This little library was inspired it's "siblings" here:

https://github.com/amio/awesome-micro#loggers-errors--reporting

Usage

npm i micro-trackjs

Basic Example

const trackjs = require("micro-trackjs");
const token = "your trackjs app token";

module.exports = trackjs(token)(async (req, res) => {
  throw Error("hello micro-trackjs");
});

Example with options

See docs for full options:
https://docs.trackjs.com/node-agent/sdk-reference/agent-options/

const trackjs = require("micro-trackjs");
const token = "your trackjs app token";

module.exports = trackjs(key, { application: "my-application" })(
  async (req, res) => {
    throw Error("hellow micro-trackjs");
  }
);

Development

git clone [email protected]:pauldariye/micro-trackjs.git
cd micro-trackjs && yarn # or npm install
yarn test

Acknowledgements

License

MIT

About

A tiny middleware to send errors to trackjs from zeit's micro framework

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published