Socket
Socket
Sign inDemoInstall

trackjs-node

Package Overview
Dependencies
0
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    trackjs-node

TrackJS Error Tracking agent for NodeJS


Version published
Weekly downloads
14K
increased by19.71%
Maintainers
1
Install size
69.7 kB
Created
Weekly downloads
 

Changelog

Source

1.1.0

  • Update NetworkWatcher to instrument the request method instead of the private _http_agent method, which breaks on some platforms.

Readme

Source


TrackJS Agent for NodeJS

Reference

Usage

To use the Agent, call TrackJS.install(options) as soon as possible in your code. It will install the monitors into the environment.

// ES5
const TrackJS = require("trackjs-node").TrackJS;
// ES6
import { TrackJS } from "trackjs-node";

TrackJS.install({
  token: "YOUR_TOKEN"
  /* other options */
});

To add more context to your errors, add context and metadata through the agent.

TrackJS.configure({
  sessionId: "session",
  version: "1.0.0",
  userId: "frank@gmail.com"
});

// or add arbitrary keys for whatever you think is important
TrackJS.addMetadata({
  foo: "bar"
});

TrackJS will automatically gather Telemetry and send errors. If you want to trigger these events yourself, you can.

TrackJS.addLogTelemetry("warn", [
  "a warning message",
  {
    /*state object*/
  }
]);

TrackJS.track(new Error("everything has gone wrong!"));

Keywords

FAQs

Last updated on 18 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc