Socket
Book a DemoInstallSign in
Socket

@fedify/botkit

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fedify/botkit

A framework for creating ActivityPub bots

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source
BotKit by Fedify

BotKit by Fedify

JSR npm GitHub Actions Codecov Fediverse

BotKit is a framework for creating ActivityPub bots. It is powered by Fedify, a lower-level library for creating ActivityPub server applications. Unlike Mastodon bots, BotKit is designed to create a standalone ActivityPub bot, which is a complete ActivityPub server in itself and not limited to Mastodon's capabilities (such as the 500-character limit per post).

BotKit's API is so simple and easy to use that you can create a complete bot in a single TypeScript file. Here's an example of a simple bot that just greets:

import { createBot, mention, text } from "@fedify/botkit";
import { RedisKvStore } from "@fedify/redis";
import { Redis } from "ioredis";

// Create a bot instance:
const bot = createBot<void>({
  // The bot will have fediverse handle "@greetbot@mydomain":
  username: "greetbot",
  // Set the display name:
  name: "Greet Bot",
  // Set the profile icon (avatar):
  icon: new URL("https://mydomain/icon.png"),
  // Set the bio:
  summary: text`Hi, there! I'm a simple fediverse bot created by ${
    mention("@hongminhee@hollo.social")}.`,
  // Use Redis as a key-value store:
  kv: new RedisKvStore(new Redis()),
  // Use Redis as a message queue:
  queue: new RedisMessageQueue(() => new Redis()),
});

// A bot can respond to a mention:
bot.onMention = async (session, message) => {
  await message.reply(text`Hi, ${message.actor}!`);
};

// Or, a bot also can actively publish a post:
const session = bot.getSession("https://mydomain/");
setInterval(async () => {
  await session.publish(text`Hi, folks! It's an hourly greeting.`);
}, 1000 * 60 * 60);

export default bot;

For more information, see the BotKit docs.

FAQs

Package last updated on 28 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts