# Config File Structure

The Critical Moments config file is a web-hosted configuration file, with a JSON structure defining how your events, actions, conditions, and feature flags connect together.&#x20;

{% hint style="success" %}
**Update Anytime**

Signing and deploying a new config file can be done outside of app releases, allowing you to update your app's behaviour without waiting for app reviews, or users to update their builds! This can be very useful for new announcement, outages, bugs, or other unexpected scenarios.

[Read the docs](/remote-control-service.md) ->&#x20;
{% endhint %}

{% hint style="warning" %}
Only the web-hosted/signed config file will be used in release builds. The local/unsigned config file is only for development/debug builds.

Be sure to deploy a signed+hosted config and set the URL before releasing your app to the app store.
{% endhint %}

### Config File Structure

The config file has the following top level entities:

* `configVersion` \[string, required]: always "v1"
* `appId` \[string, required]: your app's [bundle ID](https://developer.apple.com/documentation/appstoreconnectapi/bundle_ids)
* `actions` \[object, optional]: documented in the [Actions Overview](/actions-in-app-messaging/actions-overview.md)
* `conditions` \[object, optional]: documented in [Named Conditions](/feature-flags/named-conditions-config.md)
* `triggers` \[object, optional]: documented in [Triggers Overview](/actions-in-app-messaging/triggers.md)
* `themes` \[object, optional]: documented in [Themes Overview](/themes/theme-overview.md)
* `notifications` \[object, optional]: documented in [Notifications Spec](/notifications/notifications-spec.md)
* `minAppVersion` \[string, optional]: the minimum app version number this config file should be used on. If an older app version fetches this file, it will be ignored and Critical Moments will not start. Example: "v1.4.2"
* `minCMVersion` \[string, optional]: the minimum Critical Moments SDK version number this config file should be used on. If an older SDK version fetches this file, it will be ignored and Critical Moments will not start. Example: "v0.8.1"

Here is a sample of the typical root object in a config file:

```
{
    "configVersion": "v1",
    "appId": "YOUR_BUNDLE_ID",
    "actions: {...},
    "conditions: {...},
    "triggers": {...},
    "notifications": {...},
    "themes": {...}
}
```


---

# 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.criticalmoments.io/config-file-structure.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.
