Atex.XRPC.Client (atex v0.2.0)
View SourceSummary
Functions
Struct to store client information for ATProto XRPC.
Create a new Atex.XRPC.Client
by logging in with an identifier
and
password
to fetch an initial pair of access & refresh tokens.
Create a new Atex.XRPC.Client
from an endpoint, and optionally an
access/refresh token.
Request a new refresh_token
for the given client.
Types
Functions
Struct to store client information for ATProto XRPC.
@spec login(String.t(), String.t(), String.t(), String.t() | nil) :: {:ok, t()} | Atex.XRPC.Adapter.error()
Create a new Atex.XRPC.Client
by logging in with an identifier
and
password
to fetch an initial pair of access & refresh tokens.
Uses com.atproto.server.createSession
under the hood, so identifier
can be
either a handle or a DID.
Examples
iex> Atex.XRPC.Client.login("https://bsky.social", "example.com", "password123")
{:ok, %Atex.XRPC.Client{...}}
Create a new Atex.XRPC.Client
from an endpoint, and optionally an
access/refresh token.
Endpoint should be the base URL of a PDS, or an AppView in the case of
unauthenticated requests (like Bluesky's public API), e.g.
https://bsky.social
.
@spec refresh(t()) :: {:ok, t()} | Atex.XRPC.Adapter.error()
Request a new refresh_token
for the given client.