Latch.Client (latch v0.5.0)

Copy Markdown

Authenticated XRPC for a logged in did, with transparent token refresh.

Loads the session from config, ensuring the access token is current, and delegates to Latch.XRPC. Refresh-token rotation is single-use and serialized through Store.update_session/2.

Summary

Functions

Performs an authenticated XRPC procedure for did, with automatic refresh.

Performs an authenticated XRPC query for did, with automatic refresh.

Uploads a blob for did, with automatic refresh.

Functions

procedure(config, did, method, body, opts)

@spec procedure(Latch.Config.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Latch.Error.t()}

Performs an authenticated XRPC procedure for did, with automatic refresh.

query(config, did, method, opts)

@spec query(Latch.Config.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Latch.Error.t()}

Performs an authenticated XRPC query for did, with automatic refresh.

upload_blob(config, did, bytes, content_type, opts)

@spec upload_blob(Latch.Config.t(), String.t(), binary(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Latch.Error.t()}

Uploads a blob for did, with automatic refresh.