Skip to content

NPM version

Installation

This document details how to download and install the Node.js agent. Before installing the agent, review the requirements below. YOUTUBE

Requirements

  • Node.js 10+

Install guide

  1. Install the NerdVision package npm i @nerdvision/agent
  2. Import it into your application import { nerdvision } from '@nerdvision/agent'
  3. As early as possible in the Node app, add nerdvision.start('API_KEY')
  4. Replace 'API_KEY' with your API key from NerdVision Account
  5. The start function returns a promise. Once this has resolved, you're good to go.

Error Reporting

NerdVision supports reporting exceptions to allow for automatically capturing snapshots. To configure this you need to instrument your application with a call to the NerdVision API, or if you already use a supported service we will instrument your application automatically.

Simply add one of these calls into the exception handling code:

// import the NerdVision package
import { nerdvision } from '@nerdvision/agent'

try {
    //.. your code..
} catch (e) {
    // send the exception to nerdvision for processing
    await nerdvision.captureException(e)
}

This will ship the exception to NerdVision where we will process it and automatically install tracepoints to capture snapshots when the error happens again. You can then view the snapshots via the 'Error List' page.

See Errors for more information on how this works.

Known issues

As Node.js is an event or async environment, it can be very difficult to track a cause to the origin. Due to this, the current version of the agent might not be able to capture the error that is thrown from the line as reliably as the other agents.

Configuration

To see what options are available for configuring the agent, take a look at the Configuration

Known issues

  • When using a pre-processor for JavaScript, such as TypeScript, if files are lazy loaded at runtime their tracepoints may not trigger until they have been run for a second time.

What's next?

After you install the agent, here are some suggestions for what to do next:

  • Login to NerdVision and create a workspace for your app.
  • Set a tracepoint on a line of real code (not comments) by clicking in the gutter.
  • Execute an action in the app that will cause the tracepoint to fire and a snapshot should arrive.
  • Look at the snapshot to see what live data from you app looks like.
  • Debug all your apps!

Need more help?