# App Config API Platform-specific configuration delivered as a JSON string. Each platform (Android, iOS, LgTv, SamsungTv, AppleTv, AndroidTv) has one config entry. ## Endpoints ### Get Config ``` GET /client/v1/app-config?platform={platform} ``` **Query Parameters:** | Parameter | Type | Required | Values | |------------|------|----------|--------| | `platform` | int | Yes | `0` = Android, `1` = iOS, `2` = LgTv, `3` = SamsungTv, `4` = AppleTv, `5` = AndroidTv | **Response:** ```json { "config": "{\"feature_flags\":{\"dark_mode\":true},\"ad_interval\":30}" } ``` > `config` is a JSON string. Parse it on the client side to get the actual configuration object. **Example:** ```javascript const res = await fetch('/client/v1/app-config?platform=0'); const data = await res.json(); const config = JSON.parse(data.config); ``` --- ### Update Config (Admin) ``` PUT /admin/v1/app-config ``` Requires admin authorization. **Request Body:** ```json { "platform": 0, "config": "{\"feature_flags\":{\"dark_mode\":true},\"ad_interval\":30}" } ``` | Field | Type | Required | Description | |------------|--------|----------|-------------| | `platform` | int | Yes | Platform enum value | | `config` | string | Yes | JSON string with the configuration | **Response:** ```json true ``` --- ## Notes - Responses are cached for 10 minutes. Changes made via the admin endpoint invalidate the cache immediately. - If no config exists for a platform, the response returns `config: null`. - The `config` field is a raw string — the backend does not validate its contents. The frontend is responsible for parsing and handling it.