Installation
Please follow the installation guide first, when adding a new application to AppSignal.
Installing Appsignal for Node.js
First, sign up for an AppSignal account and run our automated install tool, which will install @appsignal/nodejs
and any relevant integrations to your project:
1
npx @appsignal/cli install
You can also skip the automated tool and add @appsignal/nodejs
to your package.json
on the command line with npm
/yarn
:
1
2
yarn add @appsignal/nodejs
npm install --save @appsignal/nodejs
Alternatively, you can manually add the @appsignal/nodejs
package to your package.json
. Then, run yarn install
/npm install
.
1
2
3
4
5
6
7
8
9
// package.json
{
"name": "my-app",
"dependencies": {
"@appsignal/nodejs": "^1.0.0",
"@appsignal/express": "^1.0.0"
}
}
Installing the AppSignal for Node.js integration builds a native extension. To compile it, macOS users will need to install the Xcode Developer Tools. Linux users will need the dependencies outlined here. Windows is not supported.
You can then import and use the package in your bundle:
1
2
3
4
5
6
7
8
9
const { Appsignal } = require("@appsignal/nodejs");
const appsignal = new Appsignal({
active: true,
name: "<YOUR APPLICATION NAME>"
apiKey: "<YOUR API KEY>"
});
// ...all the rest of your code goes here!
To auto-instrument modules, the Appsignal module must be both required and initialized before any other package.
📖 Continue with our installation guide.
Uninstalling AppSignal for Node.js
Uninstall AppSignal from your app by following the steps below. When these steps are completed your app will no longer send data to the AppSignal servers.
- In the
package.json
of your app, delete all lines referencing anappsignal
package:"*appsignal/*": "*"
. - Run
npm install
oryarn install
to update yourpackage.lock
/yarn.lock
with the removed packages state.- Alternatively, run
npm uninstall @appsignal/<package name>
oryarn remove @appsignal/<package name>
to uninstall an AppSignal package.
- Alternatively, run
- Remove any AppSignal configuration from your app.
- Commit, deploy and restart your app.
- This will make sure the AppSignal servers won't continue to receive data from your app.
- Finally, remove the app on AppSignal.com.
📖 Continue with our uninstall guide.