atproto_core library

Classes

AtUri
This is the Dart implementation of AT Uri in AT Protocol.
AtUriConverter
BaseHttpService
Blob
https://atproto.com/specs/data-model#blob-type
BlobConverter
BlobRef
https://atproto.com/specs/data-model#blob-type
Challenge
CID
This is a simple implementation of V1 CID, or a content identifier. CID is a label used to point to material in IPFS.
EmptyData
An object representing a state that is empty instead of null.
Jitter
Jwt
NSID
This is the Dart implementation of NSID in AT Protocol.
NSIDConverter
ProgressStatusEvent
Represents a progress status event, holding the total byte size of the download and the amount of bytes that have already been processed.
RateLimit
Represents the rate limit applied to an API or a service.
RateLimitPolicy
Represents a policy for rate limiting.
Request
A class that represents a Request sent during HTTP communication.
Response<D>
The class represents the response from the server.
RetryConfig
This class represents an automatic retry configuration.
RetryEvent
This class represents the event during the retry process.
Serializable
ServiceContext
Session
Represents a user session.
Subscription<T>
XRPCError
XRPCRequest
A class that represents a Request sent during XRPC communication.
XRPCResponse<D>
The class represents the response from ATP server.

Enums

HttpMethod
HttpStatus
Multicodec
Represents multicodecs types.
Platform
Protocol

Constants

cbor → const CborSimpleCodec
A constant instance of CborSimpleCodec.
defaultLinkPreviewService → const String
cardyb.bsky.app
defaultProtocol → const Protocol
The default HTTP protocol.
defaultRelayService → const String
bsky.network
defaultService → const String
bsky.social
defaultTimeout → const Duration
The default timeout duration.
emptyJson → const Map<String, dynamic>
The unmodifiable empty JSON.
jsonSerializable → const JsonSerializable
objectType → const String
$type
typeKey → const JsonKey

Functions

decodeCar(Uint8List bytes, [ProgressStatus? progress]) Map<CID, List<int>>
decodeJwt(String jwt) Jwt
Returns the decoded Jwt based on jwt.
isValidAppPassword(String appPassword) bool
Checks if a given application password is valid based on a predefined regular expression pattern.
restoreOAuthSession({required String accessToken, required String refreshToken, String? dPoPNonce, required String publicKey, required String privateKey}) OAuthSession
Returns new OAuthSession based on parameters.

Typedefs

GetClient = Future<Response> Function(Uri url, {Map<String, String>? headers})
A function type abstracted from http.get, mainly for mocking at test time.
PostClient = Future<Response> Function(Uri url, {Object? body, Encoding? encoding, Map<String, String>? headers})
A function type abstracted from http.post, mainly for mocking at test time.
ProgressStatus = void Function(ProgressStatusEvent event)
Defines a function type, ProgressStatus, that takes a ProgressStatusEvent as an argument and returns a FutureOr<void>.
ResponseDataAdaptor = Map<String, dynamic> Function(dynamic data)
Function to convert response data to an specific structure.
ResponseDataBuilder<T> = T Function(Map<String, Object?> json)
A function type that expresses the function of converting response body to model objects.

Exceptions / Errors

HttpException
This exception indicates that an unexpected error occurred when communicating with the the server.
InternalServerErrorException
InvalidCidError
Indicates that the passed CID could not be parsed.
InvalidRequestException
RateLimitExceededException
UnauthorizedException
XRPCException
This exception indicates that an unexpected error occurred when communicating with the ATP server.
XRPCNotSupportedException