> For the complete documentation index, see [llms.txt](https://coldbox.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coldbox.ortusbooks.com/getting-started/configuration/coldbox.cfc.md). Agents can also search and read this documentation through its [MCP server](https://coldbox.ortusbooks.com/~gitbook/mcp).

# The ColdBox Class

The ColdBox.bx (or .cfc for CFML) is the main applications' configuration object.

The ColdBox configuration class is the heart of your ColdBox application. It contains the initialization variables for your application and extra information used by third-party modules and ultimately how your application boots up. In itself, it is also an event listener or [ColdBox Interceptor](https://coldbox.ortusbooks.com/the-basics/interceptors.md), so it can listen to life-cycle events of your application.

![ColdBox.bx (or .cfc for CFML) EcoSystem](https://content.gitbook.com/content/XMVfvHPJ9ZanT1mSFxLz/blobs/2XowjMWSJAUESOyECMzU/Coldbox-cfc.jpg)

This class is instantiated by ColdBox and decorated at runtime so you can take advantage of some dependencies. Here is a table of the automatic injection this object has:

| **Property**          | **Description**                                                                                               |
| --------------------- | ------------------------------------------------------------------------------------------------------------- |
| `appMapping`          | The ColdBox app mapping                                                                                       |
| `coldboxVersion`      | The version of the framework                                                                                  |
| `controller`          | The ColdBox running app controller                                                                            |
| `logBoxConfig`        | A reference to a LogBox configuration object                                                                  |
| `getJavaSystem()`     | Function to get access to the java system                                                                     |
| `getSystemSetting()`  | Retrieve a Java System property or env value by name. It looks at properties first then environment variables |
| `getSystemProperty()` | Retrieve a Java System property value by key                                                                  |
| `getEnv()`            | Retrieve a Java System environment value by name                                                              |
| `webMapping`          | The application's web mapping                                                                                 |

## Configuration Storage

Once the application starts up, a reference to the instantiated configuration class will be stored in the configuration settings inside the ColdBox Main Controller (`application.cbController`) with the key `coldboxConfig`. You can then retrieve it later in your handlers, interceptors, modules, etc if you need to.

```javascript
// retrieve it
config = getSetting( 'coldboxConfig' );

// inject it
property name="config" inject="coldbox:setting:coldboxConfig";
```

## Configuration Interceptor

![ColdBox Event Listeners](https://content.gitbook.com/content/XMVfvHPJ9ZanT1mSFxLz/blobs/OSOMmWIFA05uQhzhtbHc/eventdriven.jpg)

Another cool concept for the Configuration Class is that it is also registered as a [ColdBox Interceptor](https://coldbox.ortusbooks.com/the-basics/interceptors.md) once the application starts up automatically for you. You can create functions that will listen to application events by simply registering them by name:

```javascript
function preProcess( event, interceptData, buffer, rc, prc ){
    writeDump( 'I just hijacked your app!' );abort;
}
```

{% hint style="danger" %}
Note that the config class does not have the same variables mixed into it that a "normal" interceptor has. You can still access everything you need, but will need to get it from the `controller` in the variables scope.
{% endhint %}

```javascript
function preRender( event, interceptData, buffer, rc, prc ){
    controller.getWirebox().getInstance( 'loggerService' ).doSomething();
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://coldbox.ortusbooks.com/getting-started/configuration/coldbox.cfc.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
