initialize static method

Future<void> initialize({
  1. required String namespace,
  2. required String apiUrl,
  3. bool? debug,
  4. TransportCredentials? credentials,
  5. String? redirectUrl,
})

Implementation

static Future<void> initialize({
  required String namespace,
  required String apiUrl,
  bool? debug,
  TransportCredentials? credentials,
  String? redirectUrl,
}) async {
  _apiUrl = apiUrl;
  _namespace = namespace;
  _redirectUrl = redirectUrl ?? "";
  _debug = debug ?? false;
  _transportCredentials =
      credentials ?? CloudCredentials(apiUrl: Uri.parse(_apiUrl));
  _heraClient =
      await HeraChannel.publicServiceClient(_apiUrl, _transportCredentials);
  // get public key used to validate tokens client side
  HeraRequest publicKeysReq = HeraRequest();
  HeraResponse publicKeysResp =
      await _heraClient.getPublicKeys(publicKeysReq);
  _heraPublicKey = publicKeysResp.publicKeys["hera-public-key"] ?? "";
  //initUniLinks();
}