Introduction
Motivation
This library is very opinionated, it was built to consolidate recurring code patterns from custom Blogger widgets currently employed in public-facing production blogs and widgets.
It serves a very specific use-case: read-only published posts fetching on public Blogger blogs (client()
requirements).
As such, the library may only come in handy when the excellent Gapi + Blogger v3 api may be "too much" (e.g. a lightweight preact or alpinejs widget...)
How it works
At its core there is an url builder paired with a client generator and some sensible Blogger defaults baked-in.
Url builder make()
Wrapper around native URL interface, more...
- builds on top of the native js URL interface
- takes a fully typed config object made up of Blogger params
- validates each of them against Blogger conventions
- adds defaults and normalizes output for consistency
- returns a native js URL representing the resource
client()
generator
Async function generator, more...
- builds on top of the native
fetch()
api - can be used in a handy
for await ... of
loop - lazily loops over all posts starting from input
- uses Blogger's native pagination features
- returns a fully-typed feed or error object
Disclaimer
This library is not meant to replace GAPI client and never will. It's just a different approach to fetch published posts in a read-only scenario.
It is neither affiliated or approved by Google Blogger.