
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
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 2,798 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.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.