Guides
Task-oriented documentation: one problem per page, in the order a developer usually meets them. Every Scala snippet here is compiled against the real library when the site is built, so a guide that documents a method the library does not have fails the build.
If you have never used this library, read the first one and then jump to whichever of the others you need.
The first request
- Getting started — add the dependency, build a
client, make one anonymous call, close the client. Explains what an
ExecutionContextis, for readers coming from another language. - Authentication — where a token comes from,
scopes, basic auth, anonymous, and the guarantee that a credential never
reaches a log, an error or a
toString.
Getting the answers right
- Errors — the five failures, the two error rails, how a
404actually arrives, and a complete worked recovery. Read this before you write arecoverblock: there is noNotFoundcase and noRateLimitedcase. - Pagination — the most important page here. The obvious loop over a listing is wrong against Forgejo, and it fails by silently under-reporting rather than by raising anything.
- Retries and rate limits — what is
repeated and what is never repeated,
Retry-After, and why Codeberg's rate-limit headers are not the ones you are looking for.
Living with it in a real codebase
- Observability — the
Telemetryport, a complete implementation, and why the library has no logging dependency. - Testing your code — testing what you built
on the client, without a network:
usingBackend, sttp'sBackendStub, asserting on request shape, and faking every kind of failure. - Writing data — command types, which operations are retried and which are never retried, and optimistic concurrency on file writes.
When something is different, or wrong
- Self-hosted instances — pointing the client at your own Forgejo, and discovering that instance's limits rather than assuming Codeberg's.
- Troubleshooting — a symptom-to-cause table,
from "401 with a token set" to "the
Futurenever completes".
See also
- Reference — the API groups, a glossary, and the questions the design provokes.
- Project documents — the roadmap, and Hazards, which records every measured divergence between the specification and what Codeberg actually returns. Several of these guides are downstream of that document.