poptart_core 0.1.1 copy "poptart_core: ^0.1.1" to clipboard
poptart_core: ^0.1.1 copied to clipboard

Core library for clients and tools. This package is mainly used by https://atprotodart.com packages.

poptart_core #

Core client, session, retry, blob, CAR, and shared protocol utilities for the Poptart package family.

Most applications should import package:poptart/poptart.dart. Reach for poptart_core when you are building a package, test harness, or framework layer that needs the warm filling under the main app-facing facade.

Install #

dart pub add poptart_core
import 'package:poptart_core/poptart_core.dart';

App-Password Sessions #

import 'package:poptart_core/poptart_core.dart';

Future<PoptartClient> createClient(String handle, String appPassword) async {
  final response = await createSession(
    identifier: handle,
    password: appPassword,
  );

  return PoptartClient.fromSession(response.data);
}

Service Contexts #

ServiceContext is useful when you are building reusable clients and want the same transport behavior that powers PoptartClient.

import 'package:poptart_core/poptart_core.dart';

Future<void> describeServer() async {
  final ctx = ServiceContext(
    retryConfig: RetryConfig(maxAttempts: 2),
  );

  final response = await ctx.get<String>(
    NSID.parse('com.atproto.server.describeServer'),
  );

  print(response.data);
}

Retry Configuration #

import 'package:poptart_core/poptart_core.dart';

final client = PoptartClient.anonymous(
  retryConfig: RetryConfig(
    maxAttempts: 3,
    jitter: Jitter(minInSeconds: 1, maxInSeconds: 3),
  ),
);

Utility Types #

poptart_core also exports:

  • Session, OAuthSession, and JWT helpers.
  • Blob and BlobRef models.
  • AtUriConverter, NSIDConverter, and blob converters.
  • CARDecoder for repository archive data.
  • XRPCResponse, XRPCMethodDescriptor, Subscription, and related transport types.
  • CID through poptart_multiformats.

Use this package when you need stable building blocks, not just the quick breakfast import.

0
likes
160
points
334
downloads

Documentation

Documentation
API reference

Publisher

verified publishersprk.so

Weekly Downloads

Core library for clients and tools. This package is mainly used by https://atprotodart.com packages.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#atproto #bluesky #api #core

Funding

Consider supporting this project:

github.com

License

BSD-3-Clause (license)

Dependencies

cbor, freezed_annotation, json_annotation, meta, nanoid, poptart_multiformats, poptart_oauth, poptart_primitives, poptart_xrpc

More

Packages that depend on poptart_core