eigen_client 0.1.0
eigen_client: ^0.1.0 copied to clipboard
Pure Dart client, domain, and live-session coordination for EigenInteractive games.
eigen_client #
The pure Dart runtime for EigenInteractive clients. It owns the protocol-facing domain model, generated HTTP resources, repositories, server clock, typed error mapping, socket-ticket exchange, and live-session gap recovery. It has no dependency on Flutter, Riverpod, Firebase, navigation, analytics, storage, or widgets.
Game implementors normally depend on
eigen_flutter, which composes this
package with Flutter presentation adapters. Depend on eigen_client directly
for a non-Flutter client or for pure Dart tests and tooling.
Configure authentication and transport once, then use the repositories exposed
by EigenClient:
final clock = ServerClock();
final http = Dio(BaseOptions(baseUrl: engineOrigin));
http.interceptors
..add(BearerTokenInterceptor(accessTokenProvider))
..add(clock.interceptor);
final client = EigenClient(http: http, baseUrl: engineOrigin);
final lobby = await client.games.getLobby();
final profile = await client.profile.getProfile();
The caller owns the Dio instance, including its timeouts, retry policy, token
provider, and lifecycle. EigenClient owns HTTP resource composition and
obtains a short-lived, game-scoped ticket before each live socket connection.