# Configuration

Sometimes you need to configure your module and have a different configuration for different environments. QA vs Production for example.

You can use the Backoffice to set the configuration key/values:

![](/files/-MW0CssrL0vJoDm4Yg6J)

The *key* to the Backoffice Service Configuration depends on the component.json. If it is a component with *auth* section, then the *key* is the *service.* Let's take a Slack component.json for example:

```
{
    "name": "appmixer.slack.list.NewChannelMessageRT",
    "description": "As opposed to NewChannelMessage and NewPrivateChannelMessage this trigger fires immediately every time a message is posted to a channel. Works both for public and private channels.",
    "webhook": true,
    "auth": {
        "service": "appmixer:slack",  // appmixer:slack will be used as a 'key'
        "scope": [
            "channels:read",
            "channels:history"
        ]
    },
    "outPorts": [
    ...
}
```

In this case, the *appmixer:slack* will be used as a key into the Backoffice. Then you can store various key/value pairs in the Service Configuration:

![](/files/-MW0L2QVtsaOUrvunqVO)

A good example is the *clientID* and *clientSecret*. Slack is an Oauth2 application and it needs a different Oauth application for each environment (due to the redirect URL). All of these values will be available in the component's *context* object (and in the *context* object in the auth.js file as well).

```
module.exports = {

    async tick(context) {
    
        context.auth.clientId;
        context.auth.clientSecret;
        context.auth.orAnythingElse;
        
        // all of those will be available at context.config as well
        context.config.clientId;
        context.config.clientSecret;
        context.config.orAnythingElse;        
    }
}
```

If your component/module does not use user authentication (no *auth* section in the component.json file), then the *key* to the Backoffice Service Configuration depends on the *name* of the component. Here's an example.&#x20;

```
// component.json file without "auth" section
{
    // the property "name" will be used to look for configuration stored through
    // the Backoffice. Appmixer will try to look for a key [vendor]:[service] and
    // [vendor]:[service]:[module]
    "name": "appmixer.utils.tasks.RequestApprovalEmail",
    "description": "People Task is a feature of Appmixer that allows human interaction inside workflows.",
    "webhook": true,
    "inPorts": [
        {
   ...
}
```

&#x20; For such component/module you can store configuration under *appmixer:utils* or under *appmixer:utils:tasks*. Such key/value configuration pairs will be then available under *context.config.*


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appmixer.com/6.0/v4.3/component-definition/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
