Overview
This guide covers SDK initialization options, environment configuration, logging, and event subscriptions.SDK Initialization
Basic Initialization
Production Initialization
Full Configuration
Environment Modes
| Environment | Description | API Key | Logging |
|---|---|---|---|
Development | Local development, full debugging | Optional | Debug |
Staging | Testing with real services | Required | Info |
Production | Production deployment | Required | Warning |
Logging
Set Log Level
Log Levels
| Level | Description | Use Case |
|---|---|---|
Debug | Detailed debugging info | Development |
Info | General information | Staging |
Warning | Potential issues | Production |
Error | Errors and failures | Production |
Fault | Critical failures | Always |
Custom Logger
Events
EventBus
The SDK provides a comprehensive event system for monitoring SDK activities.Event Categories
| Category | Events |
|---|---|
Initialization | started, completed, failed |
Generation | started, tokenGenerated, completed, failed, cancelled |
Model | downloadStarted, downloadProgress, downloadCompleted, loadStarted, loadCompleted, unloaded |
Voice | sttStarted, sttCompleted, ttsStarted, ttsCompleted, vadSpeechStarted, vadSpeechEnded |
Storage | cleared, modelDeleted |
Error | Various error events |