BotKit 0.4.0: PostgreSQL repository, remote follow button, and Fedify 2.x upgrade #20
dahlia
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We're pleased to announce BotKit 0.4.0. This release brings a PostgreSQL repository for production deployments, a remote follow button in the built-in web interface, a new API for broadcasting profile updates to followers, and a significant internal upgrade to Fedify 2.x—with a few API changes to go along with it.
Remote follow button (#10, #14)
Until now, discovering and following a BotKit bot required users to search for it manually from their own fediverse instance. That works well enough for users already comfortable with ActivityPub, but it's a stumbling block for anyone who isn't sure how federation works.
@dodok8 (Hyeonseo Kim) contributed a remote follow button for the bot's built-in profile page. Clicking it opens a modal where the user enters their fediverse handle—something like
@alice@fosstodon.org—and BotKit then uses WebFinger to discover their instance and redirects them to the OStatus subscribe URL, sending them directly to a follow confirmation on their home server. The feature was tested against Misskey, Hacker's Pub, and ActivityPub.Academy.A big thank-you to @malkoG for originally proposing this in #10 and to @dodok8 for implementing it in #14.
Broadcasting profile updates with
Session.republishProfile()(#18)Previously there was no first-class way to tell your bot's followers that its profile had changed. Display name, bio, avatar, and header image updates would only propagate to remote instances when the bot posted something new—because that's when those instances would re-fetch the actor. The workaround was to just wait, which isn't always acceptable.
The new
Session.republishProfile()method sends anUpdateactivity for the bot actor to all followers, triggering remote instances to re-fetch the actor immediately:This came out of #18, filed by @rmdes, who needed a way to push avatar and header updates from an admin UI without waiting for the next post. The underlying Fedify v1/v2 interop issue that motivated the request has been separately tracked in fedify-dev/fedify#651.
PostgreSQL repository (
@fedify/botkit-postgres) (#11, #19)BotKit has shipped with
@fedify/botkit-sqlitesince 0.3.0, which covers single-process deployments well. For multi-process or multi-instance setups, you need shared persistent storage, and SQLite isn't the right fit there. The new@fedify/botkit-postgrespackage fills that gap.Getting started is straightforward—pass a connection URL and you're done:
If you already have a Postgres.js client you want to reuse, you can inject it directly. In that case the repository doesn't own the client and won't close it:
The schema and tables are created automatically on first use. If you prefer to provision them ahead of time—say, in a migration step—there's also an explicit
initializePostgresRepositorySchema()helper:PostgresRepositoryOptionssupports aschemaoption (defaults to"botkit") for namespacing,maxConnectionswhen connecting via URL, and aprepareoption for environments like PgBouncer that don't support prepared statements.The package works with both Deno and Node.js, following the same patterns as
@fedify/botkit-sqlite. Install it from JSR or npm:FEP-5711 inverse properties
BotKit now includes FEP-5711 inverse properties in the bot actor's
outboxandfollowerscollections. This improves discoverability and compliance with implementations that expect these fields to be present.Improved handling of unverified
DeleteactivitiesWhen a remote server sends a
Deleteactivity signed by an actor whose key fetch returns410 Gone, BotKit previously returned401 Unauthorized—which caused the remote server to keep retrying indefinitely. BotKit now responds with202 Acceptedin this case, stopping the retry loop without actually processing the activity or passing it to any event handlers.Fedify 2.1.2 upgrade and breaking changes
This release upgrades BotKit's dependency to Fedify 2.1.2 and adopts Fedify 2.x's modular package layout. Most of the changes are internal, but a few things surface at the API level.
Message.languageandSessionPublishOptions.languagenow useIntl.Localeinstead of the customLanguageTagtype. Bot software versions are now plain strings rather thanSemVerobjects. The following public exports have been removed:parseSemVer(),SemVer,LanguageTag, andparseLanguageTag().If you were using any of these, you'll need to update your code.
LanguageTagcan be replaced withIntl.Localedirectly, and version strings can be passed as plain string literals.As always, the full changelog is available in CHANGES.md, and the documentation at botkit.fedify.dev has been updated to reflect the new APIs. If you run into any issues or have questions, feel free to open a discussion or file an issue on GitHub. Thank you to everyone who contributed code, filed bugs, and shared feedback—it genuinely shapes where BotKit goes next.
Beta Was this translation helpful? Give feedback.
All reactions