createClient function

Client createClient(
  1. CredentialOptions credentials
)

Implementation

Client createClient(CredentialOptions credentials) {
  final projectId = credentials.projectId;
  final projectSecret = credentials.projectSecret;

  final dio = Dio();
  dio.options
  ..baseUrl = ''
  ..headers = {
    'Authorization': 'Bearer $projectSecret'
  };

  final httpService = HttpService(
      dio: dio,
      token: projectSecret,
  );

  return Client(
    sendApi: SendApi(httpService),
  );
}