Install Node.js Agent

To install APM Insight Node.js agent, follow the below given instructions.

  1. Open your Node.js application.
  2. Access the node packet manager (NPM).
  3. Use the command npm i apminsight --save to install an APM Insight Node.js agent from NPM. This will create an APM Insight directory under node_modules.
  4. Include the following code in the first line of your Node.js application start file:
    require('apminsight')({
    licenseKey : '<device-key>',
    appName : '<application-name>',
    port : <application-port>
    })
    Example: require('apminsight')({
    licenseKey : 'sdafokjsoamdomkoamds',
    appName : 'myapp',
    port : 3000
    })
  5. If you use proxy connections,enter this code instead:
    require('apminsight')({
    licenseKey : '<device-key>',
    appName : '<application-name>',
    port : <application-port>  
    proxyServerHost : '<proxy-server>',
    proxyServerPort : <proxy-port>,
    proxyAuthUser : '<proxy-user-name>',
    proxyAuthPassword : '<proxy-password>' })

Note:You can find your license key by logging into Site24x7 then going to Admin>Developer> Device Key.

  1. Restart your application.
Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.