> 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/reference/configuration-directives/modules-and-settings.md).

# Modules & Module Settings

The modules and moduleSettings configuration directives — module behavior and per-module settings.

## Modules & Module Settings

The `modules` structure is used to configure the behavior of [ColdBox Modules](/the-basics/modules.md).

```javascript
modules = {
    // An array of modules to load ONLY
    include = [],
    // An array of modules to EXCLUDE for operation
    exclude = [ "paidModule1", "paidModule2" ]
};
```

***

## ModuleSettings

### Option 1: Coldbox Config

This structure within `config/Coldbox.bx` (or `.cfc` for CFML) is used to house module configurations. Please refer to each module's documentation on how to create the configuration structures. Usually the keys will match the name of the module to be configured.

{% tabs %}
{% tab title="BoxLang" %}

```js
class {

     function configure() {

         moduleSettings = {
             myModule = {
                someSetting = "overridden"
             }
        };
    }
}
```

{% endtab %}

{% tab title="CFML" %}

```cfscript
component {

     function configure() {

         moduleSettings = {
             myModule = {
                someSetting = "overridden"
             }
        };
    }
}
```

{% endtab %}
{% endtabs %}

### Option 2: Config Object Override

Starting in ColdBox 7, you can store module configurations as their own configuration file within the application’s config folder outside of the `config/Coldbox.bx` (or `.cfc` for CFML). The naming convention is `config/modules/{moduleName}.bx` (or `.cfc` for CFML)

The configuration class will have one configure() method that is expected to return a struct of configuration settings as you did before in the moduleSettings

The following example overrides the original module configuration entirely:

{% tabs %}
{% tab title="BoxLang" %}

```js
class{

    function configure( original ){
        return {
            key : value
        };
    }

}
```

{% endtab %}

{% tab title="CFML" %}

```cfscript
component{

    function configure( original ){
        return {
            key : value
        };
    }

}
```

{% endtab %}
{% endtabs %}

For large module configs where only a few keys need to be changed, you can update the config by modifying the struct passed in as an argument and then returning the updated version.

{% tabs %}
{% tab title="BoxLang" %}

```js
class{

    function configure( original ){
        // override only specific keys, not the entire config
	original.users.requireEmailVerification = false;
	return original;
    }

}
```

{% endtab %}

{% tab title="CFML" %}

```cfscript
component{

    function configure( original ){
        // override only specific keys, not the entire config
	original.users.requireEmailVerification = false;
	return original;
    }

}
```

{% endtab %}
{% endtabs %}

#### Injections

Just like a ModuleConfig this configuration override also gets many injections:

* controller
* coldboxVersion
* appMapping
* moduleMapping
* modulePath
* logBox
* log
* wirebox
* binder
* cachebox
* getJavaSystem
* getSystemSetting
* getSystemProperty
* getEnv
* appRouter
* router

#### Env Support

This module configuration object will also inherit the `ModuleConfig.bx` (or `.cfc` for CFML) behavior that if you create methods with the same name as the environment you are on, it will execute it for you as well.

```
function development( original ){
   // add overides to the original struct
}
```

Then you can change the original struct as you see fit for that environment.


---

# 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/reference/configuration-directives/modules-and-settings.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.
