Configuration¶
The CyberShield SDK allows you to customize its behavior to match your application's performance, security, and integration requirements. Configuration options can be applied during initialization or updated dynamically.
Common Configuration Options¶
| Setting | Default | Description |
|---|---|---|
| scanTimeout | 5000 |
Maximum time (ms) allowed for file or memory scans. |
| enableOfflineMode | false |
Allows scans to run without network access using local signatures. |
| logLevel | minimal |
Controls SDK logging (silent, minimal, verbose). |
| cacheResults | true |
Enables caching of repeated scan results for faster response. |
| maxFileSize | 20MB |
Maximum file size allowed for scanning. |
Example Configuration (JavaScript)¶
import CyberShield from "cybershield-sdk";
const shield = new CyberShield({
apiKey: "...",
environment: "production",
scanTimeout: 8000,
enableOfflineMode: true,
cacheResults: true,
logLevel: "verbose"
});
Example Configuration (Python)¶
from cybershield import CyberShield
shield = CyberShield(
api_key="...",
environment="production",
scan_timeout=8000,
enable_offline_mode=True,
cache_results=True,
log_level="verbose"
)
Updating Configuration Dynamically¶
You can update configuration settings after initialization.
JavaScript¶
shield.updateConfig({
scanTimeout: 10000,
logLevel: "minimal"
});
Python¶
shield.update_config({
"scan_timeout": 10000,
"log_level": "minimal"
})
Recommended Settings¶
✔ Development Environment¶
environment: "sandbox"logLevel: "verbose"enableOfflineMode: false
✔ Production Environment¶
environment: "production"logLevel: "minimal"cacheResults: true
Next Step¶
Learn how to use the SDK in a real workflow: