Android
Runtime Config
Dynamic configuration and remote config refresh
Config Precedence
SDK runtime config resolves in this order (highest priority last):
- SDK XML defaults (
kycis_config.xml, debug/release variants) - Remote config from backend
GET /v1/sdk/config - In-memory merged config exposed by
AI.getConfig()
Remote Config Fetch
The SDK fetches config asynchronously after init:
GET /v1/sdk/config
Headers:
X-KYCIS-SDK-Version: 1.0.0
X-Client-ID: your_client_id
X-API-Key: your_api_key (optional, per backend policy)Response includes:
features— boolean feature flagsthresholds— numeric thresholds (cooldowns, limits)metadata— version and targeting info
Dynamic Refresh Behavior
SDK refreshes remote config periodically during active sessions:
- Controlled by
kycis_config_refresh_interval_seconds(default 60s) AI.getConfig()always returns the latest merged snapshot- Backend changes propagate without app restart
Reading Config at Runtime
val cfg = AI.getConfig()
// Check feature flags
if (cfg.isFeatureEnabled("allow_multiple_assistant_prompt")) {
// Multiple prompts allowed with cooldown
}
// Read thresholds
val cooldown = cfg.thresholds["min_trigger_interval_seconds"]Critical Flag Example
trigger.suppress_high_time_spent (backend) is mirrored to SDK-facing feature:
suppress_high_time_spent_trigger(SDK merged config feature)
This keeps trigger suppression aligned across backend decisions and SDK-side guard logic.
Config Verification Checklist
- Update backend
kycis.yamlflag - Restart backend
- On client, wait one refresh interval (or restart app)
- Verify
AI.getConfig().isFeatureEnabled("<feature>") - Verify behavior in
/api/activity
No-Op Mode
For testing without backend:
// Use NoOpBackendClient (automatic in test mode or when backend unreachable)
// Trigger always returns false
// Session start returns errorConfiguration Files Reference
| File | Purpose |
|---|---|
android-sdk/sdk/src/main/res/values/kycis_config.xml | Production defaults |
android-sdk/sdk/src/debug/res/values/kycis_config.xml | Debug overrides |
backend/config/kycis.yaml | Backend feature flags |
backend/app/config.py | Feature flag registry |