Skip to content

Latest commit

 

History

History
31 lines (16 loc) · 2.09 KB

README.md

File metadata and controls

31 lines (16 loc) · 2.09 KB

microblog

An experiment in using PicoStack to access an API, in this case from Bluesky. This GitHub repository is 100% KRL.

Of note is that modification of the pico engine (i.e. its TypeScript code) is not required.

Separation of concerns

There are two things going on, as is typical of a web application which uses an API to access an external service.

Vendor SDK

Bluesky provides an API for creating a new post. We use a separate ruleset to implement/wrap their API. Since, conceptually, it “belongs” to them, we use their domain name as part of the ruleset ID. In this case, the SDK ruleset is named app.bsky.sdk and, really, it should actually belong to them, and/or should be contributed to them.

This ruleset uses a defaction cascade to handle not only the “happy path” but also the case where an access token needs to be refreshed. See history and commit comments for more discussion.

Client web application

A bare-bones web application is provided, PicoStack style, as a single ruleset whose ruleset ID is microblog_poster, and is 72 lines of KRL code, consisting of: