
Security News
How AI Agents Expand the Software Supply Chain Attack Surface
In his AI Council 2026 talk, Feross Aboukhadijeh covers recent package compromises, vulnerability discovery, and a more automated security model.
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 271,675 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.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
In his AI Council 2026 talk, Feross Aboukhadijeh covers recent package compromises, vulnerability discovery, and a more automated security model.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.