Skip to main content

MicroFed

Zero-dependency ActivityPub library. Pure JavaScript for embedded and edge deployments.

Overview

MicroFed is a minimal ActivityPub implementation designed for environments where size and dependencies matter. No external packages — just pure JavaScript that runs anywhere.

Philosophy

Traditional LibrariesMicroFed
Many dependenciesZero dependencies
Full-featuredEssential features only
Server-focusedRuns anywhere (browser, edge, embedded)
Complex setupDrop-in ready

Key Features

Zero Dependencies

No npm packages to install, audit, or update. The entire library is self-contained.

Universal Runtime

Works in:

  • Node.js
  • Deno
  • Browsers
  • Cloudflare Workers
  • Edge functions
  • Embedded devices

Core ActivityPub Support

Implements the essential ActivityPub operations:

  • Actor creation and management
  • Activity serialization/deserialization
  • Inbox/Outbox handling
  • HTTP Signatures (signing and verification)
  • WebFinger discovery

Small Footprint

Minimal code size for constrained environments.

Quick Start

import { Actor, Activity, sign } from 'microfed';

// Create an actor
const actor = new Actor({
id: 'https://example.com/users/alice',
type: 'Person',
preferredUsername: 'alice',
inbox: 'https://example.com/users/alice/inbox',
outbox: 'https://example.com/users/alice/outbox'
});

// Create an activity
const note = Activity.create({
type: 'Create',
actor: actor.id,
object: {
type: 'Note',
content: 'Hello from MicroFed!'
}
});

// Sign for federation
const signed = await sign(note, privateKey);

Use Cases

Edge Functions

Deploy ActivityPub endpoints on Cloudflare Workers, Vercel Edge, or Deno Deploy without cold start penalties from large dependency trees.

Browser-Based Clients

Build ActivityPub clients that run entirely in the browser.

IoT and Embedded

Run federated services on resource-constrained devices.

Serverless

Minimal bundle size means faster cold starts and lower costs.

Learning

Understand ActivityPub by reading a simple, self-contained implementation.

Comparison with FedBox

AspectMicroFedFedBox
LanguageJavaScriptGo
DependenciesZeroGo modules
StorageBring your ownBuilt-in (Bolt, SQLite, etc.)
ScopeLibraryFull server
Best forEmbeddingStandalone server

Architecture

┌─────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────┤
│ MicroFed │
│ ┌─────────┬──────────┬──────────┐ │
│ │ Actor │ Activity │ Crypto │ │
│ │ Manager │ Handler │ (sigs) │ │
│ └─────────┴──────────┴──────────┘ │
├─────────────────────────────────────┤
│ Your Storage Layer │
└─────────────────────────────────────┘

MicroFed handles the protocol — you provide the storage and HTTP layer.

  • Website: microfed.org
  • npm: Coming soon
  • GitHub: In development

See Also