Skip to content

Install the Node Agent

The Lightrun agent is at the core of the Lightrun platform. It's the component that enables us to add information at runtime, without any redeployments or restarts.

Procedure

To install the Lightrun Node.js agent:

  1. Open a terminal and change the working directory to where your project is located.
  2. Install the Node agent by entering npm install lightrun.
  3. Open your application file (e.g.,. index.js or app.js) and add the following code to the beginning of the file:

    require('lightrun').start({
         company: '<COMPANY-NAME>',
         lightrunSecret: '<COMPANY-SECRET>',
    });
    
  4. Enter the command to run your application (e.g., node index.js or npm start).

Getting company details

To see the <COMPANY_NAME> and <COMPANY_SECRET> log into the Management Portal and inspect the Download the Agent section.


Last update: September 27, 2021