馃悁 ATproto library for gleam
atproto library gleam
35

Configure Feed

Select the types of activity you want to include in your feed.

35 1 13

Clone this repository

https://tangled.org/kacaii.dev/possum https://tangled.org/did:plc:f2s2nd3tnw75so75ndrns6s2
git@tangled.org:kacaii.dev/possum git@tangled.org:did:plc:f2s2nd3tnw75so75ndrns6s2

For self-hosted knots, clone URLs may differ based on your setup.



README.md

Possum#

馃悁 ATproto library for gleam.

Helps you build HTTP requests that interact with your Personal Data Server. The user is responsible for sending the request and decode the response.

Example#

gleam add gleam_http
possum = { git = "https://tangled.org/kacaii.dev/possum", ref = "commit-hash" }
import gleam/http/request
import possum

pub fn main() -> Nil {
  // Querying your did
  request.new()
  |> request.set_host("bsky.social")
  |> possum.resolve_handle("tangled.org")

  // Acquiring a JWT token
  // App Passwords can be generated in you Bluesky settings.
  request.new()
  |> request.set_host("bsky.social")
  |> possum.create_session(
    "kacaii.dev",
    "bsky-app-password",
    option.None,
    option.None
  )

  // Including your authorization Header
  request.new()
  |> request.set_host("bsky.social")
  |> possum.authorized("my-access-token")

  // Refreshing an authorized Session
  request.new()
  |> request.set_host("bsky.social")
  |> possum.refresh_session("refresh-token")

  // Reading public data from a repository.
  // No authorization needed.
  request.new()
  |> request.set_host("bsky.social")
  |> possum.list_records(
    repository: "kacaii.dev",
    collection: "site.standard.document",
    limit: option.Some(3),
    cursor: option.None,
    reverse: option.None,
  )
}