ServiceContext class base

Constructors

ServiceContext({Map<String, String>? headers, Protocol? protocol, String? service, String? relayService, Session? session, OAuthSessionManager? oAuthSessionManager, Duration? timeout, RetryStrategy? retryConfig, GetClient? getClient, PostClient? postClient, Future<Session> onRefreshSession(Session current)?})

Properties

actorDid → String?
The DID of the authenticated actor, regardless of how this context was authenticated. Null when this context is unauthenticated.
no setter
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, String>
The global headers this context sends, without the auth header.
no setter
oAuthSessionManager → OAuthSessionManager?
The current OAuth session manager.
final
onRefreshSession → Future<Session> Function(Session current)?
Optional callback used to refresh an expired session.
no setter
onSessionUpdated → Stream<Session>
Emits the refreshed Session every time an expired access token is renewed, so the owner of the credentials can re-persist them.
no setter
relayService → String
The current relay service. Defaults to bsky.network.
final
repo → String
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
service → String
The current service host, resolved lazily on every access.
no setter
session → Session?
Returns the current session.
no setter

Methods

get<T>(NSID methodId, {String? service, Map<String, String>? headers, Map<String, dynamic>? parameters, ResponseDataBuilder<T>? to, ResponseDataAdaptor? adaptor, GetClient? client}) → Future<XRPCResponse<T>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post<T>(NSID methodId, {String? service, Map<String, String>? headers, Map<String, dynamic>? parameters, dynamic body, ResponseDataBuilder<T>? to, PostClient? client}) → Future<XRPCResponse<T>>
stream<T>(NSID methodId, {String? service, Map<String, dynamic>? parameters, ResponseDataBuilder<T>? to, ResponseDataAdaptor? adaptor, WebSocketChannelFactory? channelFactory}) → Future<XRPCResponse<Subscription<T>>>
toString() → String
A string representation of this object.
inherited
withAdditionalHeaders(Map<String, String> headers) → ServiceContext
Returns a context that shares this one's session state and sends this context's headers with headers merged in on top.
withHeaders(Map<String, String> headers) → ServiceContext
Returns a context that shares this one's session state but sends headers in place of this context's own.

Operators

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