Feature
One line of Express middleware for the agentic web.
npm install wayleave, then app.use(gate.express()). Zero dependencies, Node's native crypto only, TypeScript declarations included, and an adversarial test suite.
Built to stay out of your way
- The metering hook can throw, crash or hang — serving continues.
- Your uptime never depends on Wayleave's.
- Local verification runs in-process; nothing leaves your server that you don't send.
- Drain gate.sink.close() during graceful shutdown.
Quickstart
npm install wayleave
import Wayleave from 'wayleave';
const gate = new Wayleave({
meter: { apiKey: process.env.WAYLEAVE_METER_KEY },
});
app.use(gate.express()); // before the routes you want to observeQuestions
Which frameworks are supported?
Express and Connect-style middleware via gate.express(); gate.handleAsync() for other Node servers.