A Chrome extension that enables seamless cryptocurrency payments using the X402 protocol with Coinbase Wallet integration on Base network
autospend-x402 is an early-stage JavaScript project in the AI payments / x402 ecosystem, focused on coinbase, stablecoins, x402-payment. It currently has 0 GitHub stars and 2 forks, and sits alongside related tools like sample-agentcore-cloudfront-x402-payments, awesome-agent-payments-protocol, x402-Five-Proxy.
🚀 Quick Start · 📖 Documentation · 🤝 Contributing · 📝 Changelog
Autospend is a Chrome extension that implements the X402 protocol — an open standard for HTTP-native micropayments. It enables:
💡 X402 is inspired by HTTP status code 402 "Payment Required" — finally giving it a purpose after decades of being "reserved for future use"!
Payment-Required, Payment-Signature, Payment-Response
🔍 X402 V2 Detection
|
💰 Coinbase Wallet Integration
|
⚡ Multi-Chain Payments
|
🔒 Security First
|
# 1. Clone the repository
git clone https://github.com/AbrahamOjes/autospend-x402.git
cd autospend-x402
# 2. Install dependencies (optional, for development)
npm install
chrome://extensions/autospend-x402 folderAdding X402 payments to your website is simple — just add meta tags:
<head>
<!-- Required: Enable X402 payment -->
<meta name="x-402-payment-required" content="true">
<meta name="x-402-amount" content="0.50">
<!-- Optional: Customize payment -->
<meta name="x-402-currency" content="USDC">
<meta name="x-402-description" content="Premium article access">
<meta name="x-402-payment-url" content="/api/verify-payment">
</head>
| Meta Tag | Required | Description |
|---|---|---|
x-402-payment-required |
✅ | Set to "true" to enable payments |
x-402-amount |
✅ | Payment amount (e.g., "0.50") |
x-402-currency |
❌ | Currency code (default: USDC) |
x-402-description |
❌ | Human-readable description |
x-402-payment-url |
❌ | Custom verification endpoint |
# Start the test server
npm run dev
# Open test pages in browser
# http://localhost:9000/test-pages/x402-test.html
| Test Page | Purpose |
|---|---|
x402-test.html |
X402 detection testing |
x402-payment-test.html |
Full payment flow |
wallet-detection-test.html |
Wallet connection |
┌─────────────────────────────────────────────────────────────┐
│ Chrome Extension │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌───────────┐ │
│ │ Popup UI │◄────►│ Background │◄────►│ Content │ │
│ │ (x402-popup)│ │ Service │ │ Script │ │
│ └──────────────┘ │ Worker │ └─────┬─────┘ │
│ └──────────────┘ │ │
│ │ │
│ ┌──────────────┐ │ │
│ │ Wallet │◄───────────┘ │
│ │ Bridge │ │
│ └──────┬───────┘ │
└───────────────────────────────┼──────────────────────────────┘
│
┌───────▼────────┐
│ Coinbase Wallet│
│ (window. │
│ ethereum) │
└────────────────┘
x402-content-improved.js): Detects X402 meta tags, manages wallet bridgebackground.js): Manages extension state, handles messagingx402-popup.html/js): User interface for wallet connection and paymentswallet-bridge.js): Injected script to access wallet providerautospend-x402/
├── manifest.json # Extension manifest (Manifest V3)
├── background.js # Service worker
├── x402-content-improved.js # Main content script (consolidated)
├── wallet-bridge.js # Wallet provider bridge
├── x402-popup.html # Popup UI
├── x402-popup.js # Popup logic
├── popup-connection-handler.js # Connection management
├── constants.js # Centralized constants
├── logger.js # Logging utility
├── validation.js # Input validation
├── error-handler.js # Error handling
├── test-pages/ # Test HTML pages
├── tests/ # Test scripts
├── icons/ # Extension icons
├── package.json # Dependencies and scripts
├── README.md # This file
├── LICENSE # MIT License
├── CHANGELOG.md # Version history
└── CONTRIBUTING.md # Contribution guidelines
<!-- Required: Indicates payment is required -->
<meta name="x-402-payment-required" content="true">
<!-- Required: Payment amount -->
<meta name="x-402-amount" content="0.50">
<!-- Optional: Currency (defaults to USDC) -->
<meta name="x-402-currency" content="USDC">
<!-- Optional: Payment description -->
<meta name="x-402-description" content="Premium article access">
<!-- Optional: Custom payment endpoint -->
<meta name="x-402-payment-url" content="/api/verify-payment">
The content script exposes the following message handlers:
PING: Health checkCHECK_STATUS: Get X402 detection statusGET_WALLET_STATUS: Get wallet connection statusCONNECT_WALLET: Initiate wallet connectionMAKE_PAYMENT: Process payment# Install dependencies
npm install
# Start test server
npm run dev
# Run linting
npm run lint
# Format code
npm run format
# Build extension
npm run build
# Package for distribution
npm run package
Load extension in Chrome
chrome://extensions/Test X402 detection
npm run devhttp://localhost:9000/test-pages/x402-test.htmlTest payment flow
http://localhost:9000/test-pages/x402-payment-test.htmlwindow.ethereum is available0x14a34 (84532)<head> sectionEnable debug logging:
// In browser console
localStorage.setItem('x402-debug', 'true');
⚠️ Do not create public issues for security vulnerabilities.
Please report security issues to [email protected] with:
We welcome contributions! See CONTRIBUTING.md for detailed guidelines.
# Quick start for contributors
git clone https://github.com/AbrahamOjes/autospend-x402.git
cd autospend-x402
npm install
npm run dev
| Channel | Link |
|---|---|
| [email protected] | |
| 🐛 Issues | GitHub Issues |
| � Discussions | GitHub Discussions |
This project is licensed under the MIT License — see the LICENSE file for details.
Built with ❤️ for the Web3 community
AWS payment demo of x402 using Bedrock AgentCore, Strands SDK, and CloudFront.
🚀 Curated resources for Google's Agent Payments Protocol (AP2), A2A & x402 — blogs, videos, repos & specs. Contributions welcome!
A Next.js proxy implementing end-to-end x402 gateway integration — enabling payment-gated APIs and resources with on-chain USDC settlement on Solana, no accounts required.
A payments protocol for the internet. Built on HTTP.
Self-healing infrastructure for AI agent payments. 90.3% auto-recovery.
Daydreams is a set of tools for building agents for commerce
The best way to monetize AI applications & MCP, using x402, CDP Smart Wallets & Paymaster
URL shortener
Cloudera CDP SDK for Java