
Product
Socket for ClickUp Is Now Available
Create ClickUp tasks from Socket alerts, automate ticketing with custom rules, and keep alert and task status synchronized.
@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.
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.

Product
Create ClickUp tasks from Socket alerts, automate ticketing with custom rules, and keep alert and task status synchronized.

Product
Create and manage Asana tasks directly from Socket alerts, with manual task creation, automated ticketing rules, and two-way sync.

Security News
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.