Configuration
Learn how to configure the Meridesk Flutter SDK with advanced options.
Basic Configuration
The minimal configuration required to initialize the SDK:
import 'package:meridesk_flutter_sdk/meridesk_flutter_sdk.dart'; await MerideskSDK.initialize( websiteId: 'YOUR_WEBSITE_ID', apiKey: 'YOUR_API_KEY', );
Advanced Configuration
Custom Base URL
If you're using a self-hosted instance:
await MerideskSDK.initialize( websiteId: 'YOUR_WEBSITE_ID', apiKey: 'YOUR_API_KEY', baseUrl: 'https://your-domain.com', );
Debug Mode
Enable debug mode for development:
await MerideskSDK.initialize( websiteId: 'YOUR_WEBSITE_ID', apiKey: 'YOUR_API_KEY', debug: true, );
Environment Variables
Store your credentials securely using environment variables:
await MerideskSDK.initialize(
websiteId: const String.fromEnvironment('MERIDESK_WEBSITE_ID'),
apiKey: const String.fromEnvironment('MERIDESK_API_KEY'),
);
Theme Customization
Customize the appearance of Meridesk components:
MerideskSDK.setTheme( primaryColor: Colors.blue, accentColor: Colors.blueAccent, fontFamily: 'Roboto', );
Notification Settings
Configure push notifications:
await MerideskSDK.configureNotifications( enabled: true, sound: true, badge: true, );
Language and Localization
Set the preferred language:
MerideskSDK.setLanguage('en');
Supported languages:
- English (
en) - Spanish (
es) - French (
fr) - German (
de)
Error Handling
Configure error handling callbacks:
MerideskSDK.onError((error) {
print('Meridesk Error: ${error.message}');
});