ServerpodClientShared constructor

ServerpodClientShared(
  1. String host,
  2. SerializationManager serializationManager, {
  3. dynamic securityContext,
  4. required AuthenticationKeyManager? authenticationKeyManager,
  5. bool logFailedCalls = true,
  6. required Duration? streamingConnectionTimeout,
  7. required Duration? connectionTimeout,
})

Creates a new ServerpodClient.

Implementation

ServerpodClientShared(
  this.host,
  this.serializationManager, {
  dynamic securityContext,
  required this.authenticationKeyManager,
  this.logFailedCalls = true,
  required Duration? streamingConnectionTimeout,
  required Duration? connectionTimeout,
})  : connectionTimeout = connectionTimeout ?? const Duration(seconds: 20),
      streamingConnectionTimeout =
          streamingConnectionTimeout ?? const Duration(seconds: 5) {
  assert(host.endsWith('/'),
      'host must end with a slash, eg: https://example.com/');
  assert(host.startsWith('http://') || host.startsWith('https://'),
      'host must include protocol, eg: https://example.com/');
}