initialize
fun initialize(proxyEndpoint: String, context: Any? = null, debugLogging: Boolean = false, preload: Set<AIModel> = AIModels.DEFAULT)
Initialize SDK with proxy endpoint for secure production deployment.
This is the recommended initialization method for production apps. Your API key stays secure on your server, and the SDK receives a device-specific token for telemetry.
Device token lifecycle:
Tokens expire after 30 days
SDK automatically refreshes tokens when < 7 days remaining
7-day grace period allows continued operation during refresh
Fully transparent to app developers - no action required
// Android
try {
VT.initialize(
proxyEndpoint = "https://your-server.com/voxatrace/register",
context = this,
debugLogging = BuildConfig.DEBUG,
preload = setOf(AIModels.Pitch.REALTIME, AIModels.VAD.SPEECH)
)
} catch (e: VoxaTraceKilledException) {
// License error - disable audio features
showError("License error: ${e.message}")
}Content copied to clipboard
Your proxy server implementation:
POST /voxatrace/register
Request: { "device_id": "sha256_hash" }
Response: { "device_token": "dt_xxx", "expires_at": 1735689600 }
Proxy should:
1. Verify user is authenticated (your auth system)
2. POST to https://api.musicmuni.com/v1/voxatrace/devices/register
with Authorization: Bearer sk_live_xxx
3. Forward response to SDKContent copied to clipboard
Parameters
proxy Endpoint
Your proxy server's device registration endpoint
context
Android Context (required on Android, ignored on iOS)
debug Logging
Enable debug logging output (default: false)
preload
AI models to download at initialization (default: AIModels.DEFAULT)
Throws
if registration fails or license is invalid