JSON Configuration
Configure Monitor using local JSON configuration files. Ideal for version-controlled setups, offline environments, and CI/CD pipelines.
Overview
JSON configuration lets you define protections, logging, and other Monitor settings in a file that lives alongside your application code. This is useful for:
- Version control: Track configuration changes in git alongside your codebase
- Environment-specific configs: Different files per environment (dev, staging, production)
- Offline deployments: No dependency on the ByteHide Cloud API
- CI/CD pipelines: Automate configuration as part of your build and deploy process
Configuration Priority
When multiple configuration sources are present, they are applied in this priority order: Cloud Dashboard (highest) > JSON File > Code (Configuration API) (lowest). Cloud configuration overrides JSON settings. See Cloud Configuration for details.
Export from Cloud Dashboard
If you already have rules configured in the Cloud Dashboard, click Export config in the Workflow tab to download them as a JSON file. This gives you a ready-to-use configuration file that matches your current cloud setup.
Configuration Files
Monitor searches for configuration files in your app bundle, in this order:
monitor.config.jsonbytehide.monitor.jsonbytehide.monitor.config.jsonmonitor-config.jsonbytehide-monitor-config.json
The first file found is used. Add one of these files to your Xcode project and ensure it is included in the app bundle (Target > Build Phases > Copy Bundle Resources).
Basic Configuration
{
"apiToken": "${BYTEHIDE_TOKEN}",
"logLevel": "info",
"enableConsoleLogs": true,
"enableFileLogs": false,
"protections": [
{ "type": "DebuggerDetection", "action": "close", "intervalMs": 5000 },
{ "type": "JailbreakDetection", "action": "close", "intervalMs": 60000 },
{ "type": "TamperingDetection", "action": "close", "intervalMs": 60000 }
]
}{
"apiToken": "${BYTEHIDE_TOKEN}",
"logLevel": "info",
"enableConsoleLogs": true,
"enableFileLogs": false,
"protections": [
{ "type": "DebuggerDetection", "action": "close", "intervalMs": 5000 },
{ "type": "JailbreakDetection", "action": "close", "intervalMs": 60000 },
{ "type": "TamperingDetection", "action": "close", "intervalMs": 60000 }
]
}Complete Schema Reference
Root Configuration
| Field | Type | Default | Description |
|---|---|---|---|
apiToken | string | - | ByteHide project token (can use env vars with ${VAR} syntax) |
logLevel | string | "info" | Minimum log level: "debug", "info", "warning", "error" |
enableConsoleLogs | boolean | true | Enable console logging (NSLog / os_log) |
enableFileLogs | boolean | false | Enable file logging to disk |
protections | array | [] | Array of protection module configurations |
customActions | object | {} | Map of custom action names to handler class names |
Protection Configuration
Protections are defined as an array of objects:
{
"protections": [
{
"type": "DebuggerDetection",
"action": "close",
"intervalMs": 5000,
"enabled": true,
"parameters": {}
}
]
}{
"protections": [
{
"type": "DebuggerDetection",
"action": "close",
"intervalMs": 5000,
"enabled": true,
"parameters": {}
}
]
}| Field | Type | Default | Description |
|---|---|---|---|
type | string | - | Protection module type (PascalCase) |
action | string | "log" | "none", "log", "close", "erase", "custom" |
intervalMs | number | 5000 | Check interval in milliseconds |
enabled | boolean | true | Enable this protection |
parameters | object | {} | Module-specific configuration |
No Block Action
The iOS SDK supports five action types: none, log, close, erase, and custom. The block action is not available on iOS.
Available Protection Types
| JSON Value | Description |
|---|---|
DebuggerDetection | Detects attached debuggers (lldb, Xcode, ptrace) |
JailbreakDetection | Detects jailbroken devices (Cydia, Sileo, checkra1n) |
SimulatorDetection | Detects iOS Simulator environments |
ClockTampering | Detects system time manipulation |
MemoryDumpDetection | Detects memory dumping attempts (Frida, Cycript) |
TamperingDetection | Detects app bundle tampering and code changes |
ProcessInjection | Detects code injection and Frida gadgets |
NetworkTampering | Detects proxies, MITM tools, and VPN connections |
HardwareBinding | Detects hardware fingerprint changes |
ScreenRecordingDetection | Detects active screen recording |
ScreenshotDetection | Detects screenshots |
OverlayDetection | Detects UI overlays and tapjacking |
LibraryInjectionDetection | Detects DYLD library injection and Substrate |
KeychainIntegrityDetection | Detects Keychain integrity violations |
Recommended Intervals
| Protection | Recommended Interval | Rationale |
|---|---|---|
| DebuggerDetection | 5,000ms (5s) | Frequent checks for active debugging |
| JailbreakDetection | 60,000ms (1min) | Device state changes infrequently |
| SimulatorDetection | 300,000ms (5min) | Environment does not change at runtime |
| ClockTampering | 300,000ms (5min) | Time drift accumulates slowly |
| MemoryDumpDetection | 3,000ms (3s) | Memory attacks happen quickly |
| TamperingDetection | 60,000ms (1min) | Bundle changes are persistent |
| ProcessInjection | 5,000ms (5s) | Injection can occur at any time |
| NetworkTampering | 30,000ms (30s) | Network state can change |
| HardwareBinding | 300,000ms (5min) | Hardware does not change frequently |
| ScreenRecordingDetection | 2,000ms (2s) | Recording can start/stop quickly |
| ScreenshotDetection | 1,000ms (1s) | Screenshots are instantaneous events |
| OverlayDetection | 2,000ms (2s) | Overlays can appear dynamically |
| LibraryInjectionDetection | 5,000ms (5s) | Injection can occur at any time |
| KeychainIntegrityDetection | 60,000ms (1min) | Keychain state changes infrequently |
Environment Variables
You can reference environment variables in any string value using ${VARIABLE_NAME} syntax:
{
"apiToken": "${BYTEHIDE_TOKEN}"
}{
"apiToken": "${BYTEHIDE_TOKEN}"
}This avoids hardcoding sensitive values in configuration files.
Token Resolution Order
The project token is resolved in this order:
BYTEHIDE_MONITOR_TOKENenvironment variableBYTEHIDE_TOKENenvironment variableapiTokenvalue in the JSON fileByteHideMonitor > APITokenin Info.plist
Complete Production Example
{
"apiToken": "${BYTEHIDE_TOKEN}",
"logLevel": "warning",
"enableConsoleLogs": false,
"enableFileLogs": false,
"protections": [
{ "type": "DebuggerDetection", "action": "close", "intervalMs": 5000 },
{ "type": "JailbreakDetection", "action": "close", "intervalMs": 60000 },
{ "type": "SimulatorDetection", "action": "close", "intervalMs": 300000 },
{ "type": "ClockTampering", "action": "log", "intervalMs": 300000 },
{ "type": "MemoryDumpDetection", "action": "erase", "intervalMs": 3000 },
{ "type": "TamperingDetection", "action": "close", "intervalMs": 60000 },
{ "type": "ProcessInjection", "action": "close", "intervalMs": 5000 },
{ "type": "NetworkTampering", "action": "log", "intervalMs": 30000 },
{ "type": "HardwareBinding", "action": "log", "intervalMs": 300000 },
{ "type": "ScreenRecordingDetection", "action": "log", "intervalMs": 2000 },
{ "type": "ScreenshotDetection", "action": "log", "intervalMs": 1000 },
{ "type": "OverlayDetection", "action": "log", "intervalMs": 2000 },
{ "type": "LibraryInjectionDetection", "action": "close", "intervalMs": 5000 },
{ "type": "KeychainIntegrityDetection", "action": "erase", "intervalMs": 60000 }
]
}{
"apiToken": "${BYTEHIDE_TOKEN}",
"logLevel": "warning",
"enableConsoleLogs": false,
"enableFileLogs": false,
"protections": [
{ "type": "DebuggerDetection", "action": "close", "intervalMs": 5000 },
{ "type": "JailbreakDetection", "action": "close", "intervalMs": 60000 },
{ "type": "SimulatorDetection", "action": "close", "intervalMs": 300000 },
{ "type": "ClockTampering", "action": "log", "intervalMs": 300000 },
{ "type": "MemoryDumpDetection", "action": "erase", "intervalMs": 3000 },
{ "type": "TamperingDetection", "action": "close", "intervalMs": 60000 },
{ "type": "ProcessInjection", "action": "close", "intervalMs": 5000 },
{ "type": "NetworkTampering", "action": "log", "intervalMs": 30000 },
{ "type": "HardwareBinding", "action": "log", "intervalMs": 300000 },
{ "type": "ScreenRecordingDetection", "action": "log", "intervalMs": 2000 },
{ "type": "ScreenshotDetection", "action": "log", "intervalMs": 1000 },
{ "type": "OverlayDetection", "action": "log", "intervalMs": 2000 },
{ "type": "LibraryInjectionDetection", "action": "close", "intervalMs": 5000 },
{ "type": "KeychainIntegrityDetection", "action": "erase", "intervalMs": 60000 }
]
}Development Configuration
{
"apiToken": "${BYTEHIDE_TOKEN}",
"logLevel": "debug",
"enableConsoleLogs": true,
"enableFileLogs": false,
"protections": [
{ "type": "DebuggerDetection", "action": "none", "intervalMs": 5000 },
{ "type": "JailbreakDetection", "action": "log", "intervalMs": 60000 },
{ "type": "TamperingDetection", "action": "log", "intervalMs": 60000 },
{ "type": "ProcessInjection", "action": "log", "intervalMs": 5000 },
{ "type": "NetworkTampering", "action": "none", "intervalMs": 30000 }
]
}{
"apiToken": "${BYTEHIDE_TOKEN}",
"logLevel": "debug",
"enableConsoleLogs": true,
"enableFileLogs": false,
"protections": [
{ "type": "DebuggerDetection", "action": "none", "intervalMs": 5000 },
{ "type": "JailbreakDetection", "action": "log", "intervalMs": 60000 },
{ "type": "TamperingDetection", "action": "log", "intervalMs": 60000 },
{ "type": "ProcessInjection", "action": "log", "intervalMs": 5000 },
{ "type": "NetworkTampering", "action": "none", "intervalMs": 30000 }
]
}Advanced Interval Configuration
For fine-tuned control over detection frequency:
{
"protections": [
{
"type": "DebuggerDetection",
"action": "close",
"intervalMs": 3000
},
{
"type": "JailbreakDetection",
"action": "close",
"intervalMs": 120000
},
{
"type": "MemoryDumpDetection",
"action": "erase",
"intervalMs": 2000
}
]
}{
"protections": [
{
"type": "DebuggerDetection",
"action": "close",
"intervalMs": 3000
},
{
"type": "JailbreakDetection",
"action": "close",
"intervalMs": 120000
},
{
"type": "MemoryDumpDetection",
"action": "erase",
"intervalMs": 2000
}
]
}Performance Impact
Lower intervals mean more frequent checks but higher CPU and battery usage. Balance security needs with performance and battery requirements for mobile applications.
Next Steps
Cloud Configuration
Configure protections from the web dashboard with real-time sync
Configuration API
Code-based configuration for custom actions and programmatic control
Protection Modules
Complete reference of all available protection modules
Actions
All action types and when to use each one