Sdk class

Global SDK entry point.

Initialize the singleton once with init, then access modules such as call, auth, events, cache, and queue through instance.

Sdk.init(
  SdkConfig(
    baseUrl: 'https://api.example.com',
    profile: SdkProfile.defaultSecure(),
    contract: SdkContract.auto(
      data: 'data',
      message: 'message',
    ),
    output: OutputOptions.jsonOnly(),
  ),
);

Properties

auth ↔ SdkAuth
Authentication API for login, refresh, and sign-out flows.
latefinal
authManager AuthManager
Token manager used internally by auth and retry flows.
latefinal
cache CacheStore
Cache store used for offline GET fallbacks.
latefinal
call ↔ SdkCall
Request API for HTTP calls.
latefinal
config SdkConfig
Initialization settings used to build the SDK modules.
final
events SdkEvents
Event hub for session lifecycle notifications.
latefinal
hashCode int
The hash code for this object.
no setterinherited
http HttpClient
HTTP client used by the SDK.
latefinal
interceptors ↔ InterceptorRunner
Interceptor pipeline built from SdkConfig.interceptors.
latefinal
queue ↔ SdkQueue
Queue API used to flush queued requests.
latefinal
queueStore QueueStore
Queue store used for offline write persistence.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
signOut({bool emitEvent = true}) Future<void>
Clears persisted authentication state.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance Sdk
Returns the initialized SDK singleton.
no setter

Static Methods

init(SdkConfig config) → void
Initializes or replaces the global SDK singleton.
resetForTest() → void
Resets the singleton for tests.