service property

String get service

The current service host, resolved lazily on every access.

Precedence: an explicit service: override, then the legacy session's PDS endpoint, then the OAuth manager's current PDS host, then the default service. Resolving lazily (rather than freezing the host at construction) means an OAuthSessionManager that restores or refreshes its session later — so its PDS materializes or changes after this context was built — is picked up on the next request instead of every call being pinned to bsky.social. Defaults to bsky.social.

Implementation

String get service {
  final current = session;

  return _explicitService ??
      (current != null ? _sessionPdsEndpoint(current) : null) ??
      oAuthSessionManager?.currentPdsHost ??
      defaultService;
}