fedi_auth

Basic Authentication package for Fediverse instances i.e. Mastodon, GoToSocial, Pleroma, etc.

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.1.1
License AGPL-3.0-or-later
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Authors

  • Paul Wilde

Installation

nimble install fedi_auth
choosenim install fedi_auth
git clone https://codeberg.org/pswilde/fedi_auth

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
fedi_auth - - - - - - -

Dependencies

Package Version Optional
nim >= 1.6.0 No

Source

Repository https://codeberg.org/pswilde/fedi_auth
Homepage https://codeberg.org/pswilde/fedi_auth
Registry Source nimble_official

README

Fedi Auth

A basic fediverse authentication library for Nim

Usage

Please see tests/login.nim for a working example

let client = newFediClient()
client.instance = "your-home-instance.com"
client.name = "MyReallyCoolApp"
let token = client.getToken()
if client.verify(): echo "Verified!"

You can then use this library to send your own HttpClient requests with the Authorization header:

let c = newHttpClient()
c.headers = newHttpHeaders({
  "Authorization": client.tokenStr
})

client.tokenStr is a procedure that simply returns

Bearer YOURTOKEN

Testing

This library has been tested with GoToSocial, Mastodon, Pleroma, Akkoma and Rebased. It should, in theory, work with any fediverse instance that implements MastoAPI endpoints for authentication

---

Have fun!
Any comments, let me know on the fediverse at @paul@notnull.space