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

@payai/x402-hono-starter

v1.0.2

Published

Create an x402 Hono server in less than 2 minutes!

Readme

x402 Hono Starter

A Hono application with x402 payment protocol integration, providing a modern web framework alternative to Next.js with the same payment functionality.

Features

  • Hono Framework: Fast, lightweight web framework for Bun/Node.js
  • x402 Payment Integration: Built-in payment middleware for micro-payments
  • TypeScript Support: Full TypeScript support with proper type definitions
  • Tailwind CSS: Utility-first CSS framework for styling
  • API Routes: RESTful API endpoints with payment protection
  • Static File Serving: Built-in static file serving for assets

Getting Started

Requirements

  • Node.js: 18 or newer

Create a new app using the template

npm (npx)

npm exec @payai/x402-hono-starter -- my-x402-app

pnpm

pnpm dlx @payai/x402-hono-starter my-x402-app

bun

bunx @payai/x402-hono-starter my-x402-app

Then inside your new app:

npm run dev

Manual Installation

  1. Clone or download this starter template
  2. Install dependencies:
bun install
  1. Copy the environment file:
cp env.local .env.local
  1. Update your environment variables in .env.local:
# Replace with your actual wallet address
RESOURCE_WALLET_ADDRESS=YourAddress

# Facilitator URL
FACILITATOR_URL=https://facilitator.payai.network
  1. Start the development server:
bun run dev
  1. Open http://localhost:3000 in your browser

Project Structure

src/
├── index.ts                 # Main application entry point
├── routes/
│   ├── home.tsx            # Home page route
│   ├── premium.tsx         # Premium content page
│   └── api/
│       ├── weather/        # Weather API endpoint
│       └── premium/
│           └── content/    # Premium content API
├── styles/
│   └── globals.css         # Global styles with Tailwind
└── ...

API Endpoints

Free Endpoints

  • GET / - Home page
  • GET /premium - Premium content page

Protected Endpoints (Require Payment)

  • GET /api/weather - Weather data (requires $0.001 USDC)
  • GET /api/premium/content - Premium content (requires custom token payment)

Payment Configuration

The payment middleware is configured in src/index.ts:

const paymentConfig = {
  '/api/weather': {
    price: '$0.001',
    network: 'base-sepolia',
  },
  '/api/premium/*': {
    price: {
      amount: '100000',
      asset: {
        address: '0xabc',
        decimals: 18,
        eip712: {
          name: 'WETH',
          version: '1',
        },
      },
    },
    network: 'base-sepolia',
  },
};

Available Scripts

  • bun run dev - Start development server with hot reload
  • bun run build - Build the application for production
  • bun run start - Start the production server
  • bun run lint - Run ESLint
  • bun run format - Format code with Prettier
  • bun run format:check - Check code formatting

Development

The application uses:

  • Hono for the web framework
  • x402-hono for payment middleware
  • TypeScript for type safety
  • Tailwind CSS for styling
  • ESLint and Prettier for code quality

Deployment

The application can be deployed to any platform that supports Bun or Node.js:

  1. Build the application: bun run build
  2. Start the production server: bun run start

License

Apache-2.0