init method
Initialize API
Takes baseUrl and apiKey as arguments
Implementation
Future<void> init({
required ElevenLabsConfig config,
}) async {
_dio
..options.baseUrl = config.baseUrl
..options.connectTimeout = const Duration(seconds: 5)
..options.receiveTimeout = const Duration(seconds: 3)
..options.headers = {
'Content-Type': 'application/json',
'xi-api-key': config.apiKey,
};
if (Platform.isIOS || Platform.isAndroid) {
_dio.httpClientAdapter = HttpClientAdapter();
}
}