bluesky-social / atproto

Social networking technology created by Bluesky
Other
6.64k stars 466 forks source link

Make it more clear how to instantiate an anonymous agent #2986

Open prenaissance opened 2 days ago

prenaissance commented 2 days ago

Is your feature request related to a problem? Please describe.

It is unclear from the documentation of @atproto/api how to create an anonymous Agent (for xRPC invocation on the com.atproto NSID).

Describe the solution you'd like

Declare a default constructor with the url set to "https://bsky.social/xrpc" or add this in the jsdoc.

Describe alternatives you've considered

After looking through the source code and the Python client implementation I figured that it's supposed to be instantiated via

import { Agent } from "@atproto/api"

const agent = new Agent("https://bsky.social/xrpc");
prenaissance commented 2 days ago

Would be happy to open a PR if deemed as valid, by the way.