> ## 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 JavaScript configuration options

export const Compatibility = ({versions = [], label = "Available in"}) => {
  if (!Array.isArray(versions) || versions.length === 0) {
    return null;
  }
  const defaultPillStyle = {
    borderColor: "#d4d4d8",
    background: "#f4f4f5",
    color: "#3f3f46"
  };
  const pillStyles = {
    "AppSignal for Elixir": {
      background: "#f3e8ff",
      borderColor: "#d8b4fe",
      color: "#6b21a8"
    },
    "AppSignal for Front-end": {
      background: "#fef9c3",
      borderColor: "#fde047",
      color: "#854d0e"
    },
    "AppSignal for Go": {
      background: "#ccfbf1",
      borderColor: "#5eead4",
      color: "#115e59"
    },
    "AppSignal for JavaScript": {
      background: "#fef9c3",
      borderColor: "#fde047",
      color: "#854d0e"
    },
    "AppSignal for Node.js": {
      background: "#dcfce7",
      borderColor: "#86efac",
      color: "#166534"
    },
    "AppSignal for Python": {
      background: "#dbeafe",
      borderColor: "#93c5fd",
      color: "#1e40af"
    },
    "AppSignal for Ruby": {
      background: "#fee2e2",
      borderColor: "#fca5a5",
      color: "#991b1b"
    },
    "AppSignal for Rust": {
      background: "#ffedd5",
      borderColor: "#fdba74",
      color: "#9a3412"
    }
  };
  const getPillStyle = name => ({
    ...defaultPillStyle,
    ...pillStyles[name] || ({})
  });
  return <div className="not-prose my-4 rounded-lg border border-zinc-200 bg-zinc-50 px-4 py-3 text-sm dark:border-white/10 dark:bg-white/5">
      <div className="flex flex-wrap items-center gap-x-2 gap-y-1">
        <span className="font-semibold text-zinc-700 dark:text-zinc-200">
          {label}:
        </span>
        {versions.map((v, i) => <span key={`${v.name}-${v.version}-${i}`} className="inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium" style={getPillStyle(v.name)}>
            <span>{v.name}</span>
            <span className="opacity-70">
              {v.version}
              {v.exact ? "" : "+"}
            </span>
          </span>)}
      </div>
    </div>;
};

The following list includes all configuration options with the name of the environment variable and the name of the key in the configuration file.

For more information on how to configure AppSignal with a configuration file, see our [Configuration](/front-end/configuration) topic.

## `key`

* **Type:** `string`

<Tip>
  This configuration option is **required** to send data to AppSignal. If this
  configuration option is not set, AppSignal for JavaScript will run in
  development mode, and no data will be sent to AppSignal.
</Tip>

The front-end error monitoring API key for your application. You can find this API key under "Front-end error monitoring" in the ["Push & Deploy"](https://appsignal.com/redirect-to/app?to=api_keys) section of your application's settings.

This is **not** the same as the organization-level or application-level API key, which is used for monitoring in our back-end integrations.

## `namespace`

* **Type:** `string`
* **Default value:** `"frontend"`

The default namespace to use to report errors to AppSignal. Read more in our [namespaces guide](/guides/namespaces).

## `revision`

* **Type:** `string`

Set the app revision for the currently running version of your app. This is used to create deploy markers and tag all incoming data as belonging to a specific deploy. Read more in our [deploy markers guide](/application/markers/deploy-markers).

## `ignoreErrors`

* **Type:** `RegExp[]`

An array of regular expressions to check against the `message` property of any error reported to AppSignal. If any of the regular expressions matches, the error is ignored. Read more in our [ignoring errors guide](/guides/filter-data/ignore-actions).

## `matchBacktracePaths`

<Compatibility versions={[{ name: "AppSignal for JavaScript", version: "1.5.0" }]} />

* **Type:** `RegExp[]`

<Warning>
  This configuration option is useful when developing applications for desktop and
  mobile environments, or when deploying the same application environment to multiple domains.
  **Most applications will not need to use this configuration option.**

  **Using this configuration option will break [public sourcemap
  detection](/front-end/sourcemaps#public-sourcemaps).** To use this
  configuration option with a sourcemapped codebase, you must upload private
  sourcemaps for your application.

  This configuration option is **experimental** and may change in future versions.
</Warning>

An array of regular expressions with one or more match groups. These regular expressions will be checked against the backtrace line paths of errors reported to AppSignal. If any of the regular expressions matches with one or more non-empty match groups, the path in the backtrace line is replaced with the result of concatenating the match groups.

This is useful when the path at which your application is deployed is not known ahead of time. For example, the path to an
Electron application may be different on each user's machine. You can match for the part of that path that is known to represent
your application.

For example, if your application's source code is located at a path like the following, where `${USERNAME}` changes for each user:

<CodeGroup>
  ```sh Shell theme={null}
  /Users/${USERNAME}/Applications/MyApp.app/Contents/Resources/bundle/app.js`
  ```
</CodeGroup>

Then you can use this configuration option as follows:

<CodeGroup>
  ```javascript JavaScript theme={null}
  const appsignal = new Appsignal({
    // ... other configuration options ...
    matchBacktracePaths: [new RegExp("MyApp.app/Contents/Resources/(.*)")],
  });
  ```
</CodeGroup>

When an error is reported, the backtrace line paths will be replaced with the result of the match group, which in this example will be `bundle/app.js`.

This ensures that errors reported to AppSignal are grouped correctly when using backtrace line grouping, and allows for [private sourcemaps](/api/sourcemaps) to be uploaded for the cleaned path.
