๐Ÿ€ ATproto library for gleam
atproto library gleam
34

Configure Feed

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

readme: add App Password usage example

kacaii.dev (Jul 2, 2026, 11:47 AM -0300) c8399b9a b9e19865

+26 -2
+26 -2
README.md
··· 23 23 ### Consulting your DID 24 24 25 25 ```gleam 26 + import gleam/http/request 27 + import possum 28 + 26 29 // Resolve an atproto handle (hostname) to a DID. 27 30 // 28 31 // You can consult your identifier by sending a request directly to your PDS, ··· 44 47 ### Querying Public Data 45 48 46 49 ```gleam 50 + import gleam/http/request 51 + import possum 52 + 53 + let assert Ok(did) = did.parse("did:plc:ewvi7nxzyoun6zhxrhs64oiz") 54 + 47 55 // Reading public data from repositories. 48 56 // No authorization needed. 49 57 request.new() 50 58 |> request.set_host("personal.data-server.pds") 51 59 |> possum.list_records( 52 - did: did, 53 - collection: "site.standard.document", 60 + did, 61 + collection: "sh.tangled.repo", 54 62 limit: option.Some(3), 55 63 cursor: option.None, 56 64 reverse: option.None, ··· 60 68 ### Authorized Requests 61 69 62 70 ```gleam 71 + import gleam/http/request 72 + import possum 73 + 74 + let assert Ok(did) = did.parse("did:plc:ewvi7nxzyoun6zhxrhs64oiz") 75 + 76 + // App Passwords can be generated in your Bluesky settings, 77 + // It allows authorized access to your PDS. 78 + request.new() 79 + |> request.set_host("personal.data-server.pds") 80 + |> possum.create_session( 81 + did, 82 + app_password: "bsky-app-password", 83 + allow_takendown: option.None, 84 + auth_factor_token: option.None 85 + ) 86 + 63 87 // Include a authorization Header for requests that require authentication. 64 88 request.new() 65 89 |> request.set_host("personal.data-server.pds")