# @contrast/config

> An API for discovering Contrast agent configuration data

Latest version **1.63.0** (published 2026-08-19) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install @contrast/config
pnpm add @contrast/config
yarn add @contrast/config
bun add @contrast/config
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.63.0 |
| Published | 2026-08-19 |
| First published | 2022-06-16 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18.7.0 |
| Dependencies | 4 |
| Unpacked size | 64.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Contrast Security |
| Maintainers | tough-griff, chrisdunne, contrast_admin, jcolekaplan, contrastsec, mhenry-contrast, nbuckwalt |

## Links

- npm: https://www.npmjs.com/package/@contrast/config
- npm.io page: https://npm.io/package/@contrast/config

## Dependencies (4)

- [yaml](https://npm.io/package/yaml.md) 2.9.0
- [deepmerge](https://npm.io/package/deepmerge.md) 4.3.1
- [@contrast/core](https://npm.io/package/@contrast/core.md) 1.68.0
- [@contrast/common](https://npm.io/package/@contrast/common.md) 1.42.0

## Recent versions

- 1.63.0 (latest) — 2026-08-19
- 1.62.0 — 2026-07-31
- 1.61.0 — 2026-07-13
- 1.60.0 — 2026-06-16
- 1.59.0 — 2026-06-12
- 1.58.3 — 2026-06-01
- 1.58.2 — 2026-04-17
- 1.58.1 — 2026-03-31
- 1.58.0 — 2026-03-26
- 1.57.1 — 2026-03-06
- 1.57.0 — 2026-03-03
- 1.56.0 — 2026-02-04
- 1.55.1 — 2026-01-23
- 1.55.0 — 2025-12-16
- 1.54.1 — 2025-12-02
- … 81 more at https://npm.io/package/@contrast/config/versions

## README

# `@contrast/config`

<br>

> Note: This package needs help.
>  * Needlessly dependent on `commander`, `lodash`, and `json-stable-stringify`
>  * Can be simplified
>  * Could benefit from schema-based approach for defaults

<br>

## Overview

This is legacy code ported from `node-agent` repo.

To discover and log configuration data, try

```shell
node -e "console.log(new (require('.').Config)())"
```

## Usage

An agent should use a single instance of a config. On instantiation, the config will detect both yaml file and environment variable sources and build out full config object. The object will have defaults set for values not having been set by file or env vars.

```typescript
const { AgentConfig } = require('@contrast/config');
const config = new AgentConfig();

// do stuff with config
if (config.protect.enable) {

}
```

## New V5 Options

 - `agent.stack_trace_filters`

   This allows agent stackframes to be filtered via configuration
   Default: `agent-,@contrast,node-agent`

---
_Source: https://npm.io/package/@contrast/config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
