
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@toolkit-p2p/feed
Advanced tools
Social feed and content aggregation for toolkit-p2p with CRDT-based post management and Web of Trust filtering.
pnpm add @toolkit-p2p/feed
import { PostManager, Feed } from '@toolkit-p2p/feed';
import { BulletinBoard } from '@toolkit-p2p/bulletin';
import { SocialGraph } from '@toolkit-p2p/social';
// Initialize dependencies
const bulletin = new BulletinBoard(/* ... */);
const socialGraph = new SocialGraph(/* ... */);
// Create post manager and feed
const postManager = new PostManager(bulletin, 'my-peer-id');
const feed = new Feed(postManager, socialGraph);
// Simple post
const post = await postManager.createPost('Hello, decentralized world!');
// Post with media
const post = await postManager.createPost('Check out this image', {
media: [{
cid: 'bafybeig...',
type: MediaType.IMAGE,
mimeType: 'image/jpeg',
size: 12345,
}],
tags: ['photography', 'nature'],
});
// Reply to a post
const reply = await postManager.createPost('Great post!', {
replyTo: post.id,
});
// Get feed from followed peers
const followingFeed = await feed.getFollowingFeed({ limit: 20 });
// Get global feed
const globalFeed = await feed.getGlobalFeed({ limit: 50 });
// Get recommended feed based on Web of Trust
const recommended = await feed.getRecommendedFeed({
limit: 20,
minTrustScore: 0.5,
maxDegrees: 2,
});
// Get posts by specific author
const profileFeed = await feed.getProfileFeed('peer-id', { limit: 10 });
// Get posts with a tag
const tagFeed = await feed.getTagFeed('javascript', { limit: 15 });
// Get full thread with replies
const thread = await feed.getThread(rootPostId);
console.log(thread.root); // Root post
console.log(thread.replies); // Map of parent ID -> replies
console.log(thread.totalPosts); // Total posts in thread
// Add reaction
await postManager.addReaction(postId, '👍');
// Remove reaction
await postManager.removeReaction(postId);
// Get all reactions
const reactions = await postManager.getReactions(postId);
// Add keyword filter
feed.addModerationRule({
id: 'spam-filter',
type: 'keyword',
pattern: /spam|advertisement/i,
action: ModerationAction.HIDE,
reason: 'Spam detected',
});
// Filter by trust score
feed.addModerationRule({
id: 'low-trust',
type: 'trust',
minTrust: 0.3,
action: ModerationAction.WARN,
reason: 'Low trust score',
});
// Custom filter
feed.addModerationRule({
id: 'custom',
type: 'custom',
filter: (post) => post.content.length > 5000,
action: ModerationAction.WARN,
reason: 'Very long post',
});
// Search posts
const results = await feed.searchPosts('decentralization', {
followedOnly: true,
limit: 10,
});
The feed integrates with @toolkit-p2p/social to filter content based on:
┌─────────────────┐
│ Feed │ Timeline aggregation & filtering
└────────┬────────┘
│
┌────┴────┬──────────┐
│ │ │
┌───▼────┐ ┌──▼──────┐ ┌▼──────────┐
│ Post │ │ Social │ │ Bulletin │
│Manager │ │ Graph │ │ Board │
└────────┘ └─────────┘ └───────────┘
MIT
FAQs
Social feed and content aggregation for toolkit-p2p
We found that @toolkit-p2p/feed demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.