Serum.Atproto (serum_md v1.7.0)

Copy Markdown View Source

AT Protocol HTTP client for interacting with PDS (Personal Data Server) repositories. Provides authentication and repository record creation/updating according to ATproto lexicons.

Summary

Functions

Authenticates with AT Protocol PDS server using a handle/DID and password (or App Password).

Constructs an AT-URI for a document record.

Constructs an AT-URI for a publication record.

Creates or replaces a record in an AT Protocol repository collection using com.atproto.repo.putRecord.

Types

session()

@type session() :: %{
  did: String.t(),
  handle: String.t(),
  access_jwt: String.t(),
  pds_url: String.t()
}

Functions

create_session(pds_url \\ nil, identifier, password)

@spec create_session(String.t() | nil, String.t(), String.t()) ::
  {:ok, session()} | {:error, String.t()}

Authenticates with AT Protocol PDS server using a handle/DID and password (or App Password).

document_at_uri(did, rkey)

@spec document_at_uri(String.t(), String.t()) :: String.t()

Constructs an AT-URI for a document record.

publication_at_uri(did, rkey \\ "self")

@spec publication_at_uri(String.t(), String.t()) :: String.t()

Constructs an AT-URI for a publication record.

put_record(session, collection, rkey, record)

@spec put_record(session(), String.t(), String.t(), map()) ::
  {:ok, %{uri: String.t(), cid: String.t()}} | {:error, String.t()}

Creates or replaces a record in an AT Protocol repository collection using com.atproto.repo.putRecord.