Skip to content

Commit

Permalink
docs: demonstrate barebones usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mary-ext committed Feb 27, 2024
1 parent 8607b88 commit f14e119
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/bluesky-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,16 @@ For the most part, it is 1:1 with the official library's typings, but it's also
It's slightly annoying in that a function accepting `AppBskyActorDefs.ProfileViewBasic` can't also accept `ProfileViewDetailed` without making it a union. (depending on how you see it)

However, it allows for AT Protocol's discriminated unions to be typed properly, and that's the best part about this approach.

## Barebones usage

If you don't need the session handling that `Agent` class offers, you can import
the `XRPC` class directly, this shaves the bundle size from 6.2 KB to 2.8 KB.

```ts
import type { Procedures, Queries } from '@externdefs/bluesky-client/atp-schema';
import { XRPC } from '@externdefs/bluesky-client/xrpc';

export type Agent = XRPC<Queries, Procedures>;
export const Agent = XRPC<Queries, Procedures>;
```

0 comments on commit f14e119

Please sign in to comment.