{"id":32828443,"url":"https://github.com/zachalam/x402proxy","last_synced_at":"2025-11-07T19:01:47.049Z","repository":{"id":322937965,"uuid":"1083914609","full_name":"zachalam/x402proxy","owner":"zachalam","description":"Launch a payment-ready API in minutes. Accept X402 payments and sell secure one-time API access with a single config.","archived":false,"fork":false,"pushed_at":"2025-11-07T05:21:01.000Z","size":175,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-07T07:17:08.959Z","etag":null,"topics":["api","blockchain","payments","proxy","proxy-server","x402","x402client","x402gateway","x402protocol","x402server"],"latest_commit_sha":null,"homepage":"https://x402proxy.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zachalam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-27T00:17:26.000Z","updated_at":"2025-11-07T05:20:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zachalam/x402proxy","commit_stats":null,"previous_names":["zachalam/x402proxy"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/zachalam/x402proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachalam%2Fx402proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachalam%2Fx402proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachalam%2Fx402proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachalam%2Fx402proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zachalam","download_url":"https://codeload.github.com/zachalam/x402proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachalam%2Fx402proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283240964,"owners_count":26803282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-07T02:00:06.343Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","blockchain","payments","proxy","proxy-server","x402","x402client","x402gateway","x402protocol","x402server"],"created_at":"2025-11-07T19:00:25.515Z","updated_at":"2025-11-07T19:01:47.042Z","avatar_url":"https://github.com/zachalam.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![x402proxy](web/images/x402proxy.png)\n\n# 💰 x402proxy\n\n**Monetize Any API in Minutes** • Automatically accept x402 Payments • Simple Config, Zero Code Changes Required\n\n[![zachalam/x402proxy](https://img.shields.io/docker/v/zachalam/x402proxy)](https://hub.docker.com/r/zachalam/x402proxy) [![GitHub stars](https://img.shields.io/github/stars/zachalam/x402proxy.svg?style=social\u0026label=Star)](https://github.com/zachalam/x402proxy) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)\n\n\u003c/div\u003e\n\n---\n\n## 🚀 What is x402proxy?\n\nA **plug-and-play proxy** that automatically accepts x402 payments.\n\nSet it up in minutes in front of any existing API and start selling one-time access. \nUse a simple config file to customize which endpoints to monetize and set your prices.\n\n## 🚦 Getting Started\n\n### 📋 Prerequisites\n\n- **Docker** and **Docker Compose**\n\nThat's it! No complex dependencies or setup required.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n## ⚡ Quick Start\n\n**🚀 Get up and running in under 60 seconds**\n\n\u003c/div\u003e\n\n\u003e **📥 Step 1: Download Starter Config**\n\u003e \n\u003e ```bash\n\u003e curl -o custom-config.json https://raw.githubusercontent.com/zachalam/x402proxy/refs/heads/main/custom-config.json\n\u003e ```\n\u003e \n\u003e **🐳 Step 2: Run with Docker**\n\u003e \n\u003e ```bash\n\u003e docker run -p 8080:8080 \\\n\u003e   -v $(pwd)/custom-config.json:/app/config.json:ro \\\n\u003e   ghcr.io/zachalam/x402proxy:latest\n\u003e ```\n\u003e \n\u003e **✅ That's it!** Your API proxy is now running and accepting x402 payments. 🎉\n\n---\n\n### ✨ Key Features\n\n| Feature | Description |\n|---------|-------------|\n| 🌐 **Multi-chain support** | Works with Ethereum, Base, Solana, and more |\n| 💰 **Direct payments** | Paywall any URL; payment straight to your wallet |\n| 🏗️ **Flexible pricing** | Set one-time global or per-route pricing |\n| 🔌 **Plug \u0026 play** | Works with any standard x402 facilitator |\n\n### 📊 How It Works\n\n![x402proxy sequence diagram](diagrams/mermaid-diagram.svg)\n\n**Simple architecture, powerful results.** Clients make requests, payments are verified via x402 facilitator, and your API gets protected automatically.\n\n---\n\n## ⚙️ Configuration\n\n### 📝 Config File Location\n\nThe application loads configuration **strictly from `/app/config.json`** inside the container. \n\n\u003e ⚠️ **Important:** If this file is not mounted, the container will exit with an error.\n\n### 🔧 Configuration Fields\n\n| Field | Description |\n|-------|-------------|\n| `facilitatorUrl` | The X402 facilitator URL |\n| `network` | Blockchain network (e.g., \"base-sepolia\") |\n| `paymentAddress` | Receiving wallet address |\n| `defaultPrice` | Default payment price for all routes |\n| `protectedEndpoints` | Map of protected endpoints with prices and forwarding URLs |\n\n### 📄 Sample Configuration\n\nHere's a complete example configuration file (`custom-config.json`):\n\n```json\n{\n  \"facilitatorUrl\": \"https://x402.org/facilitator\",\n  \"network\": \"base-sepolia\",\n  \"paymentAddress\": \"0x5629562956295629562956295629562956295629\",\n  \"defaultPrice\": \"$0.05\",\n  \"protectedEndpoints\": {\n    \"GET /cat\": {\n      \"forwardTo\": \"https://api.thecatapi.com/v1/images/search\"\n    },\n    \"GET /dog\": {\n      \"price\": \"$0.10\",\n      \"forwardTo\": \"https://api.thedogapi.com/v1/images/search\"\n    },\n    \"GET /fact\": {\n      \"price\": \"$0.15\",\n      \"forwardTo\": \"https://catfact.ninja/fact\"\n    },\n    \"GET /joke\": {\n      \"price\": \"$0.20\",\n      \"forwardTo\": \"https://official-joke-api.appspot.com/random_joke\"\n    }\n  }\n}\n```\n\n\u003e 💡 **Tip:** For large `protectedEndpoints` configurations, file mounting is recommended (no size limits).\n\n---\n\n## 🐳 GitHub Container Registry\n\n### 🔄 Automatic Builds\n\nThe application is **automatically built and pushed** to GitHub Container Registry (ghcr.io) on every push to the main branch. \n\nEach push creates a new version tagged with an auto-incremented version number and also tagged as `latest`.\n\n### 📦 Pull \u0026 Run Latest Image\n\n```bash\n# Pull the latest image\ndocker pull ghcr.io/zachalam/x402proxy:latest\n\n# Run with default port (config must be mounted to /app/config.json)\ndocker run -p 8080:8080 \\\n  -v $(pwd)/custom-config.json:/app/config.json:ro \\\n  ghcr.io/zachalam/x402proxy:latest\n\n# Run with custom external port\ndocker run -p 4020:8080 -e PORT=8080 \\\n  -v $(pwd)/custom-config.json:/app/config.json:ro \\\n  ghcr.io/zachalam/x402proxy:latest\n```\n\n\n---\n\n## 💻 Local Development\n\n### 🚫 Without Docker\n\nPerfect for quick local testing and development:\n\n```bash\n# Install dependencies\nnpm install\n\n# Run in development mode with nodemon (hot reload)\nnpm run dev\n\n# Run in production mode\nnpm start\n```\n\n\u003e 📍 The application will be available at `http://localhost:3000`\n\n---\n\n### 🐳 With Docker (Recommended)\n\nUse Docker for a consistent development environment with hot reload:\n\n```bash\n# Build and run the development container with hot reload\ndocker-compose up\n\n# Run in detached mode (background)\ndocker-compose up -d\n\n# View logs\ndocker-compose logs -f\n\n# Stop the container\ndocker-compose down\n```\n\n\u003e 📍 The application will be available at `http://localhost:3000`\n\n\u003e ⚠️ **Note:** You must mount your config to `/app/config.json`. If the file is missing, the container will exit with an error.\n\n---\n\n## 🏗️ Architecture\n\n| Environment | Details |\n|-------------|---------|\n| **Development** (`docker-compose.yml`) | Uses nodemon for hot reload, mounts source code as volume |\n| **Production** (`Dockerfile`) | Optimized image with only production dependencies, runs as non-root user |\n\n---\n\n## 📄 License\n\nThis project is licensed under the **ISC License**.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n### ⭐ Star this repo if you find it useful!\n\n[![GitHub stars](https://img.shields.io/github/stars/zachalam/x402proxy.svg?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/zachalam/x402proxy)\n\n**Built with ❤️ for the x402 ecosystem**\n\n[Report Bug](https://github.com/zachalam/x402proxy/issues) • [Request Feature](https://github.com/zachalam/x402proxy/issues) • [Contribute](https://github.com/zachalam/x402proxy/pulls)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachalam%2Fx402proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzachalam%2Fx402proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachalam%2Fx402proxy/lists"}