> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AppSignal for Node.js load order

AppSignal for Node.js can be configured in a couple of different ways - through the `Appsignal` constructor or environment variables.

The configuration is loaded in a four-step process, starting with the package defaults and ending with reading environment variables. The configuration options can be mixed without losing configuration from a different option.

## Load orders

* 1. [Package defaults - `default`](#1-module-defaults)
* 2. [System detected settings - `system`](#2-system-detected-settings)
* 3. [Environment variables - `env`](#3-environment-variables)
* 4. [`Appsignal` constructor - `initial`](#4-initial-configuration-given-to-appsignal-constructor)

## 1. Module defaults

The AppSignal module starts with loading its default configuration, setting paths and enabling certain features.

The agent defaults can be found in the [configuration options documentation](/nodejs/3.x/configuration/options).

## 2. System detected settings

The package detects what kind of system it's running on and configures itself accordingly.

For example, when it's running inside a container-based system (such as Docker and Heroku) it sets the configuration option `runningInContainer` to `true`.

## 3. Environment variables

AppSignal will look for its configuration in environment variables. When found these will override all given configuration options from previous steps.

<CodeGroup>
  ```bash Bash theme={null}
  export APPSIGNAL_APP_NAME="my custom app name"
  # start your app here
  ```
</CodeGroup>

## 4. Initial configuration given to `Appsignal` constructor

When initializing the `Appsignal` object, you can pass in the initial configuration you want to apply. This is an `object` of any of the options described below.

<CodeGroup>
  ```javascript Node.js theme={null}
  new Appsignal({
    active: true,
    name: "<YOUR APPLICATION NAME>",
    pushApiKey: "<YOUR API KEY>",
  });
  ```
</CodeGroup>

This step will override all given options from the defaults or system detected configuration.
