
Security News
GPT-6 Astra Attempts Supply Chain Attacks Against Open Source Maintainers in Testing
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.
Deprecated (v1)
This npm package implements x402 v1. It is deprecated and will only receive security patches. Please migrate to v2 (@x402/coreand related packages). See the Migration guide: v1 to v2. Legacy examples are available at git tagarchive/legacy-v1-examples.
Core TypeScript implementation of the x402 Payment Protocol. This package provides the foundational types, schemas, and utilities that power all x402 integrations.
npm install x402
The x402 package provides the core building blocks for implementing the x402 Payment Protocol in TypeScript. It's designed to be used by:
This core package is used by the following integration packages:
x402-express: Express.js middlewarex402-hono: Hono middlewarex402-next: Next.js middlewarex402-fetch: Fetch API wrapperx402-axios: Axios interceptorIf you're not using one of our server middleware packages, you can implement the x402 protocol manually. Here's what you'll need to handle:
For a complete example implementation, see our advanced server example which demonstrates both synchronous and asynchronous payment processing patterns.
If you're not using our x402-fetch or x402-axios packages, you can manually integrate the x402 protocol in your client application. Here's how:
Make a request to a x402-protected endpoint. The server will respond with a 402 status code and a JSON object containing:
x402Version: The version of the x402 protocol being usedaccepts: An array of payment requirements you can fulfillSelect the payment requirement you wish to fulfill from the accepts array
Create the payment header using the selected payment requirement
Retry your network call with:
X-PAYMENT fieldAccess-Control-Expose-Headers field set to "X-PAYMENT-RESPONSE" to receive the server's transaction responseFor implementation examples, we recommend reviewing our official client packages:
FAQs
x402 Payment Protocol
The npm package x402 receives a total of 226,392 weekly downloads. As such, x402 popularity was classified as popular.
We found that x402 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.

Product
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.

Security News
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.