Overview
TheClientConfig interface defines the configuration options for initializing the Advanced iMessage Kit SDK client.
Interface Definition
Fields
serverUrl
The URL of the iMessage server to connect to.The base URL of your BlueBubbles server. Should include the protocol (http/https) and port number.
http://localhost:1234- Local development serverhttps://your-server.com- Remote server with SSLhttp://192.168.1.100:1234- Local network server
apiKey
API key for authenticating with the iMessage server.Your BlueBubbles server API key. Required for servers with authentication enabled. Can be found in your BlueBubbles server settings.
logLevel
Logging level for the SDK.Controls the verbosity of SDK logs. Higher levels include all lower levels.
debug- Detailed debugging informationinfo- General informational messageswarn- Warning messageserror- Error messages only
error- Only critical errorswarn- Errors + warningsinfo- Errors + warnings + general info (default)debug- Everything including detailed debug traces
logToFile
Whether to write logs to a file.When enabled, SDK logs are written to a file in addition to console output. Useful for debugging and monitoring in production.
Log files are stored in the SDK’s log directory. Set to
false in development to reduce disk usage.Complete Examples
Minimal Configuration
Connect to a local server without authentication:serverUrl:http://localhost:1234logLevel:infologToFile:true- No API key (legacy mode)
Production Configuration
Secure configuration for production use:Development Configuration
Verbose logging for debugging:Remote Server Configuration
Connect to a remote BlueBubbles server:Environment Variables
Recommended approach for managing configuration:TypeScript Types
The configuration is fully typed for TypeScript users:Best Practices
Use environment variables for sensitive data
Use environment variables for sensitive data
Never hardcode API keys or server URLs in your source code. Use environment variables or secure secret management systems.
Adjust log levels for different environments
Adjust log levels for different environments
Use verbose logging in development and minimal logging in production:
Disable file logging in serverless environments
Disable file logging in serverless environments
In ephemeral environments like AWS Lambda or Docker containers, disable file logging:
Validate configuration on startup
Validate configuration on startup
Always validate your configuration before connecting:
See Also
- AdvancedIMessageKit - Main SDK client class
- Quick Start - Getting started guide
- Authentication - Authentication setup guide