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

create-x402-app

v0.1.10

Published

Create a new x402 pay-per-request API project

Downloads

1,021

Readme

create-x402-app

Create a new x402 pay-per-request API project with one command.

Overview

create-x402-app is a CLI tool that scaffolds production-ready x402 projects with pre-configured examples, wallet integration, and payment handling. Get started with HTTP 402 payments on Mantle Network in minutes.

Quick Start

npx create-x402-app my-app
cd my-app
npm run dev

Installation

No installation required. Use npx to run the CLI directly:

npx create-x402-app [project-name]

Usage

Interactive Mode

Run without arguments to use interactive prompts:

npx create-x402-app

The CLI will prompt you for:

  • Project name
  • Project type (Fullstack or Backend only)
  • Framework (Hono or Express)
  • Package manager (npm, yarn, pnpm, bun)
  • Whether to install dependencies

Command Line Arguments

# Create project with specific name
npx create-x402-app my-api

# Specify project type and framework
npx create-x402-app my-api --fullstack --express
npx create-x402-app my-api --backend --hono

# Use specific package manager
npx create-x402-app my-api --bun
npx create-x402-app my-api --pnpm
npx create-x402-app my-api --yarn

# Skip dependency installation
npx create-x402-app my-api --skip-install

Available Templates

The CLI provides 4 production-ready templates:

Backend Templates

backend-hono - Standalone Hono API server

  • Fast, lightweight Hono framework
  • Web Standards based
  • Minimal dependencies

backend-express - Standalone Express API server

  • Popular Express.js framework
  • Mature ecosystem
  • Extensive middleware support

Fullstack Templates

fullstack-hono - Next.js app with Hono API routes

  • Next.js 16 with App Router
  • Hono for API routes
  • Complete frontend + backend

fullstack-express - Next.js app with Express-style API routes

  • Next.js 16 with App Router
  • Express-compatible API routes
  • Complete frontend + backend

What's Included

Each generated project includes:

  • x402-mantle-sdk pre-installed and configured
  • TypeScript configuration with strict mode
  • Tailwind CSS for styling
  • Example API routes:
    • /api/info - Free endpoint (no payment required)
    • /api/premium - Paid endpoint (0.001 MNT)
    • /api/weather - Paid endpoint (0.0005 MNT)
  • Demo frontend with wallet connection UI
  • Payment modal integration
  • Environment configuration with .env.example
  • Git configuration with .gitignore

Getting Started

1. Get Your App ID

  1. Visit the x402 Dashboard
  2. Connect your wallet
  3. Create a new project
  4. Copy your App ID

2. Configure Environment

cp .env.example .env

Edit .env and add your App ID:

X402_APP_ID=your-app-id-here
X402_PLATFORM_URL=https://mantle-x402.vercel.app

3. Start Development

npm run dev

Open http://localhost:3000 to see your app.

Project Structure

my-app/
├── src/
│   ├── app/
│   │   ├── api/          # API routes
│   │   │   ├── info/     # Free endpoint
│   │   │   ├── premium/  # Paid endpoint
│   │   │   └── weather/   # Paid endpoint
│   │   ├── page.tsx      # Demo frontend
│   │   └── layout.tsx    # Root layout
│   ├── components/        # UI components
│   └── lib/              # Utilities
├── public/               # Static assets
├── .env.example          # Environment template
└── package.json

Next Steps

Related Packages

  • x402-mantle-sdk - Core SDK for HTTP 402 payments
    • View on npm
    • Server middleware, client SDK, and React components

Resources

License

MIT