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

Core library for XRPC communication. This is a wrapped HTTP client for AT Protocol.

poptart_xrpc #

Low-level XRPC transport for Dart and Flutter.

Use poptart_xrpc when you want direct control over query, procedure, subscription, and descriptor calls. Most apps should use PoptartClient from poptart, but this package is the crisp transport layer underneath it.

Install #

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

Raw Query #

import 'package:poptart_xrpc/poptart_xrpc.dart';

Future<void> main() async {
  final response = await query<String>(
    NSID.parse('com.atproto.server.describeServer'),
    service: 'bsky.social',
  );

  print(response.data);
}

Client Form #

import 'package:poptart_xrpc/poptart_xrpc.dart';

Future<void> main() async {
  final client = XRPCClient(service: 'bsky.social');

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

  print(response.status);
}

Generated Descriptor Calls #

import 'package:bluesky_poptart/app/bsky/actor/get_profile.dart'
    as get_profile;
import 'package:poptart_xrpc/poptart_xrpc.dart';

Future<void> main() async {
  final client = XRPCClient();

  final profile = await client.call(
    get_profile.appBskyActorGetProfile,
    parameters: const get_profile.ActorGetProfileInput(actor: 'bsky.app'),
  );

  print(profile.data.handle);
}

What It Handles #

  • GET queries, POST procedures, and websocket subscriptions.
  • XRPCMethodDescriptor and generated method values.
  • Request parameter cleanup and JSON conversion.
  • Auth headers, custom header builders, test clients, and timeouts.
  • XRPC error mapping for unauthorized, rate limited, invalid request, and server errors.

It is intentionally transport-focused: no OAuth session management, no app-level state, just the XRPC toaster slot.

0
likes
160
points
3.82k
downloads

Documentation

Documentation
API reference

Publisher

verified publishersprk.so

Weekly Downloads

Core library for XRPC communication. This is a wrapped HTTP client for AT Protocol.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#atproto #bluesky #http #xrpc

Funding

Consider supporting this project:

github.com

License

BSD-3-Clause (license)

Dependencies

freezed_annotation, http, json_annotation, mime, poptart_primitives, web_socket_channel

More

Packages that depend on poptart_xrpc