initialize static method

void initialize(
  1. ApillonConfig? apiConfig
)

Implementation

static void initialize(ApillonConfig? apiConfig) {
  final config = ApillonConfig(
    key: apiConfig?.key ?? Platform.environment['APILLON_API_KEY'],
    secret: apiConfig?.secret ?? Platform.environment['APILLON_API_SECRET'],
    apiUrl: apiConfig?.apiUrl ?? 'https://api.apillon.io',
    logLevel: apiConfig?.logLevel ?? LogLevel.NONE,
  );

  headers = {'content-type': 'application/json'};
  if (config.key != null &&
      config.key != "" &&
      config.secret != null &&
      config.secret != "") {
    headers['authorization'] = 'Basic ${base64Encode(utf8.encode(
      '${config.key}:${config.secret}',
    ))}';
  }
  apiUrl = config.apiUrl!;
}