/
Downloading the Node.js agent file

Downloading the Node.js agent file

Agent File

Our Node.js agents (slnodejs) are published in the npm registry. You download it and all its dependencies using the npm repository commands.

Downloading latest version

npm i slnodejs

For Customers that need to set a specific recommended agent version other than the default latest, the API will provide the recommended agent version that has been set on the dedicated settings page from the dashboard.

In the following examples, replace $DOMAIN with your domain and $SL_TOKEN with your SeaLights agent token

Linux

# Fetch Agent version defined in Sealights dashboard settings $SLVERSION=$(curl -X GET "https://$DOMAIN.sealights.co/api/v2/agents/slnodejs/recommended" -H "accept: application/json" -H "Authorization: Bearer $SL_TOKEN" -L) # Install Sealights Agent (Recommended version) npm i slnodejs@$SLVERSION

PowerShell

# Fetch Agent version defined in Sealights dashboard settings $SLVERSION = Invoke-RestMethod -Uri "https://$DOMAIN.sealights.co/api/v2/agents/slnodejs/recommended" -Headers @{ "accept" = "application/json", "Authorization" = "Bearer $SL_TOKEN"} # Install Sealights Agent (Recommended version) npm i "slnodejs@$SLVERSION"

GitLab YML

 

Related content

Using Node.js Agent - Generating a session ID
Using Node.js Agent - Generating a session ID
More like this
SeaLights Node.js agent - Command Reference
SeaLights Node.js agent - Command Reference
More like this
Using Node.js Agents - Scanning a build
Using Node.js Agents - Scanning a build
Read with this
.Net - How to ensure I am running the latest/recommended agent version
.Net - How to ensure I am running the latest/recommended agent version
More like this
Using Node.js Agents - Running backend server using SeaLights agent
Using Node.js Agents - Running backend server using SeaLights agent
Read with this
How to make sure Sealights agent is up to date
How to make sure Sealights agent is up to date
More like this