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

Provide an HTTP client specialized for XRPC communication in AT Protocol.

example/example.dart

// Copyright 2023 Kato Shinya. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

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
0
points
2.81k
downloads

Publisher

verified publisheratprotodart.com

Weekly Downloads

Provide an HTTP client specialized for XRPC communication in AT Protocol.

Repository (GitHub)
View/report issues

Funding

Consider supporting this project:

github.com

License

unknown (license)

Dependencies

freezed_annotation, http, json_annotation, meta, nsid

More

Packages that depend on xrpc