npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

swarm-comment-react-example

v0.0.3

Published

This project provides an example React application demonstrating real-time, decentralized comment functionality built on Swarm. It utilizes the following core components:

Readme

Swarm Comment React Example ⚛️🐝💬

This project provides an example React application demonstrating real-time, decentralized comment functionality built on Swarm. It utilizes the following core components:

This example showcases how to integrate swarm-comment-js into a React frontend to create a functional comment interface.


📋 Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js
  • pnpm (or npm)
  • Access to one or more running Swarm Bee nodes:
    • One for the client application to connect to (swarm-comment-js).

🚀 Getting Started

Follow these steps to get the example application up and running:

1. Clone the Repository

git clone https://github.com/Solar-Punk-Ltd/swarm-comment-react-example.git
cd swarm-comment-react-example

2. Install Dependencies

pnpm install
# or
npm install

4. Configure the React Example

This application uses environment variables for configuration. Create a .env file in the root of the swarm-comment-react-example project directory. You can copy the .env.example file if one is provided:

cp .env.example .env

Now, edit the .env file with the necessary values. These correspond to the CommentSettings required by the swarm-comment-js library:

# .env

VITE_BEE_URL= Address of the node that will be used by swarm-comment-js
VITE_COMMENT_STAMP = Stamp used to write to the comment

5. Run the Application

Once configured, start the development server:

pnpm run dev
# or
npm run dev

🧐 Understanding the Code

The core integration with swarm-comment-js can typically be found in:

  • A custom React hook (e.g., src/hooks/useSwarmComment.ts if you've structured it that way, similar to the example in the swarm-comment-js README).

The CommentSettings object, populated from the environment variables, is passed to the SwarmComment constructor from the swarm-comment-js library.


📌 Important Notes

  • Example Only: This application is an example to demonstrate functionality. It may lack features, robust error handling, or security measures found in a production application.
  • Private Key Handling: The method for handling keys in this example is for demonstration purposes. Secure private key management is critical for real applications.
  • Swarm Network: Ensure your Bee nodes are properly connected to the Swarm network and have sufficient funds/postage stamps for operations.