# Configuration

The Configuration feature in the ComUnity Toolkit offers a comprehensive solution for managing application-wide settings, including the ability to configure settings for different deployment environments such as Development, Quality Assurance(QA), and Production. This powerful tool allows developers to easily tailor their application's behaviour and appearance to suit specific deployment environments.

All the configuration settings that exist in your project, including environment-specific configurations, are persisted in the Config service. This ensures that you can define and maintain separate settings for each environment, providing flexibility and control over the application's behaviour in different stages of the development and deployment lifecycle.

By leveraging the Configuration feature, developers can easily switch between different environment configurations within the ComUnity Toolkit. This allows them to define environment-specific settings such as AppName, BaseURL, ComsApi, WelcomeMessage, PushRootName, MediaServerUploadUrl, and more. Each environment can have its own distinct configuration values, enabling seamless transitions and consistent behaviour when deploying the application across different environments.

The persistence of environment-specific configuration settings in the Config service simplifies the management and maintenance of these settings. Developers can easily update and modify the configurations for each environment without directly modifying code, ensuring a clear separation between development and deployment concerns.

In summary, the Configuration feature in the ComUnity Toolkit empowers developers to set environment-specific configurations for Development, QA, and Production environments. By leveraging the Config service, developers can define and maintain distinct settings for each environment, ensuring flexibility, consistency, and optimal behaviour of their applications across different stages of the development and deployment lifecycle.

To add a configuration setting to your project, follow these steps:

1.  Open your project in the Toolkit and navigate to Project Settings then select the **Configuration** tab.\


    <figure><img src="https://content.gitbook.com/content/h2CgaYxTJg9abC9usaCb/blobs/eoKM3n30R4BmF9GOsjFp/image.png" alt=""><figcaption><p>Configuration settings of a Project</p></figcaption></figure>
2. Within the Configuration tab, you will find deployment environments displayed in a tab view. The initial tab labelled as **Development**, shows the system-generated settings for you development environment.
3. Locate the **(+) Add a configuration setting** button associated with a specific deployment environment.
4.  Click on the button to add a new configuration setting for that particular environment.\


    <div align="left"><figure><img src="https://content.gitbook.com/content/h2CgaYxTJg9abC9usaCb/blobs/5lnF7o04mZDJJOiU86E9/image.png" alt="" width="375"><figcaption></figcaption></figure></div>
5. In the modal window, provide a unique name for your configuration in the designated **Name** box the value of your application setting in the **Value** box.
6. Finally, click **Add** to create the configuration.

Once you've created the configuration settings, you can refer to them throughout your application. These settings are stored within the Config service and can be accessed and utilised in various parts of your application's code.&#x20;

```csharp
// To invoke an application setting in your code:
Config.{{Application Setting}}
// A real life example referencing FaultEmail application setting
Config.FaultEmail()
```

Below is a list of common system-generated configuration variables that you'll typically encounter when working with new projects in the ComUnity Platform's Development deployment environment:

1. AppName: The AppName variable represents the name or title of your application. It serves as an identifier within the ComUnity Platform, helping to distinguish your application from others during the development phase.
2. BaseUrl: The BaseUrl variable specifies the base URL or web address of your application. It defines the starting point for all relative URLs within your application and is essential for proper routing and navigation during development.
3. ComsApi: The ComsApi variable refers to the API endpoint or URL of the communication service within the ComUnity Platform. It enables your application to interact with the communication service, facilitating the exchange of messages, notifications, and other communication-related tasks during development.
4. ComsService: The ComsService variable is a URL that represents the specific communication service employed within the application.&#x20;
5. ComsServicePassword: The ComsServicePassword variable stores the password or secret key associated with the communication service in the Development environment. It is instrumental in authenticating and securely accessing the service.
6. ComsServiceUsername: The ComsServiceUsername variable stores the username or identifier used for authentication and identification within the communication service during development. It allows your application to connect and interact with the service using the designated user or account within the Development environment.
7. MediaServerUploadUrl: The MediaServerUploadUrl variable denotes the URL or endpoint of the media server responsible for uploading and storing media files within the ComUnity Platform's Development environment. It enables your application to seamlessly upload images, videos, or other media content for use within the platform during development.
8. PublishedAppName: The PublishedAppName variable represents the name of your application as it appears to end users or the public within the Development environment. It is commonly utilised for displaying the application name in user interfaces or when referencing the published version of your application during development.
9. WelcomeMessage: The WelcomeMessage variable contains a pre-defined message or greeting displayed to users when they initially interact with your application in the Development environment. It serves as a friendly introduction or provides essential instructions to guide users through their initial experience during development.
