
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
@payweave/express
Advanced tools
Express middleware for PayWeave - accept per-request USD micropayments on any Express route.
Express middleware for PayWeave - accept per-request USD micropayments on any Express route.
npm install @payweave/express
import { Payweave } from '@payweave/express';
import express from 'express';
const app = express();
const payweave = new Payweave(
process.env.PAYWEAVE_APP_ID!,
process.env.PAYWEAVE_APP_SECRET!
);
app.get(
'/api/weather',
payweave.charge({ price: '0.001', description: 'Weather API' }),
(req, res) => {
res.json({ temp: 72, unit: 'F' });
}
);
app.listen(3000);
new Payweave(appId, appSecret, baseUrl?)| Parameter | Type | Description |
|---|---|---|
appId | string | Your app key ID |
appSecret | string | Your app secret |
baseUrl | string? | API base URL (defaults to https://api.payweave.app) |
payweave.charge(options)Returns Express middleware (req, res, next) => Promise<void>.
| Option | Type | Description |
|---|---|---|
price | string | (req) => string | Promise<string> | USD price per request |
description | string? | Human-readable description |
meta | Record<string, string>? | API metadata for agent discovery |
app.get(
'/api/search',
payweave.charge({ price: '0.01' }),
(req, res) => {
res.json({ results: [] });
}
);
app.post(
'/api/generate',
payweave.charge({
price: (req) => req.body.premium ? '0.05' : '0.01',
description: 'Text generation API',
}),
(req, res) => {
res.json({ text: 'generated content' });
}
);
app.post(
'/api/sentiment',
payweave.charge({
price: '0.005',
description: 'Sentiment analysis',
meta: {
'method': 'POST',
'input.content-type': 'application/json',
'input.schema': '{"type":"object","properties":{"text":{"type":"string"}}}',
'output.schema': '{"type":"object","properties":{"score":{"type":"number"}}}',
},
}),
(req, res) => {
res.json({ score: 0.85 });
}
);
app.get('/api/weather', payweave.charge({ price: '0.001' }), weatherHandler);
app.get('/api/forecast', payweave.charge({ price: '0.005' }), forecastHandler);
app.post('/api/analyze', payweave.charge({ price: '0.01' }), analyzeHandler);
402 Payment Required and a WWW-Authenticate header containing pricingAuthorization: Payment <credential>Payment-Receipt headerMIT
FAQs
Express middleware for PayWeave - accept per-request USD micropayments on any Express route.
The npm package @payweave/express receives a total of 2 weekly downloads. As such, @payweave/express popularity was classified as not popular.
We found that @payweave/express demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.