xrpc 1.0.3 copy "xrpc: ^1.0.3" to clipboard
xrpc: ^1.0.3 copied to clipboard

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

xrpc

Core library for XRPC communication πŸ¦‹

1. Guide 🌎 #

This library provides the easiest way to use XRPC communication supported by AT Protocol in Dart and Flutter apps.

1.1. Getting Started ⚑ #

1.1.1. Install Library #

With Dart:

 dart pub add xrpc

Or With Flutter:

 flutter pub add xrpc

1.1.2. Import #

import 'package:xrpc/xrpc.dart';

1.1.3. Implementation #

import 'package:atproto/atproto.dart' as atproto;
import 'package:xrpc/xrpc.dart' as xrpc;

Future<void> main() async {
  final response = await xrpc.procedure(
    xrpc.NSID.create(
      'session.atproto.com',
      'create',
    ),
    body: {
      'handle': 'HANDLE',
      'password': 'PASSWORD',
    },
    to: atproto.Session.fromJson,
  );

  final session = await xrpc.query(
    xrpc.NSID.create(
      'session.atproto.com',
      'get',
    ),
    headers: {'Authorization': 'Bearer ${response.data.accessJwt}'},
    to: atproto.CurrentSession.fromJson,
  );

  print(session);
}
2
likes
160
points
5.29k
downloads

Publisher

verified publisheratprotodart.com

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

Documentation

Documentation
API reference

Funding

Consider supporting this project:

github.com

License

BSD-3-Clause (license)

Dependencies

at_primitives, freezed_annotation, http, json_annotation, mime, web_socket_channel

More

Packages that depend on xrpc