Bitsocial React Hooks v0.1.52

Build your corner
of the internet.

A social network to build on. React hooks to make it yours.
Bring your interface. The communities are already here.

npm install @bitsocial/bitsocial-react-hooks
Editable
YourFeed.jsxReact
import { useFeed } from "@bitsocial/bitsocial-react-hooks";

function YourFeed({ communityName }) {
  const { feed, hasMore, loadMore } = useFeed({
    communities: [{ name: communityName }],
    sortType: "hot",
    postsPerPage: 3,
  });

  return (
    <div className="preview-feed">
      <header className="preview-feed-header">
        <img className="preview-community-icon" src="/playground/builders-icon.webp" alt="" />
        <div><strong>Community feed</strong><small>{communityName}</small></div>
      </header>
      {feed.map(post => (
        <article className="preview-post" key={post.cid}>
          <div className="preview-byline">
            <span className="preview-avatar" data-author={post.author.address} aria-hidden="true">
              {post.author.displayName?.slice(0, 1)}
            </span>
            <div><strong>{post.author.displayName}</strong><small>{post.author.shortAddress}</small></div>
          </div>
          <h2>{post.title}</h2>
          <p>{post.content}</p>
          {post.thumbnailUrl && <img className="preview-post-image" src={post.thumbnailUrl} alt="A handmade radio on a shared workshop table" />}
          <footer className="preview-post-meta">
            <span>↑ {(post.upvoteCount ?? 0) - (post.downvoteCount ?? 0)} points</span>
            <span>{post.replyCount} replies</span>
          </footer>
        </article>
      ))}
      {hasMore && (
        <button onClick={() => void loadMore()}>
          Load more
        </button>
      )}
    </div>
  );
}
Your app, your designLive preview
Real hook APIs. Simulated content. Nothing is published.Explore useFeed

You bring the idea.
The hooks do the plumbing.

Feeds, conversations, accounts, and publishing.
Compose what you need into something new.

One network, many possibilities

The next social app
could be yours.

Build a forum for a niche you care about. Try a different kind of feed. Give an existing community a better home.

Bitsocial is an open peer-to-peer network. Compatible apps can share communities and content, while competing on what makes them useful.

Read the call to builders

Bring your AI collaborator.

The same docs, ready for your coding agent. Plain Markdown, a compact index, and the full reference.

Build with AI