
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@usageflow/express
Advanced tools
Express.js middleware for UsageFlow API tracking. Easily monitor and analyze your Express.js API usage with real-time tracking and allocation management.
npm install @usageflow/express
const express = require('express');
const { ExpressUsageFlowAPI } = require('@usageflow/express');
const app = express();
app.use(express.json());
// Initialize UsageFlow with API key
const usageFlow = new ExpressUsageFlowAPI('YOUR_API_KEY');
// Apply middleware
app.use(usageFlow.createMiddleware());
// Your routes
app.get('/api/users', (req, res) => {
res.json({ users: ['John', 'Jane'] });
});
app.listen(3000, () => {
console.log('Server running on port 3000');
});
import express from 'express';
import { ExpressUsageFlowAPI } from '@usageflow/express';
const app = express();
app.use(express.json());
// Initialize UsageFlow with API key
const usageFlow = new ExpressUsageFlowAPI('YOUR_API_KEY');
// Apply middleware
app.use(usageFlow.createMiddleware());
// Your routes
app.get('/api/users', (req, res) => {
res.json({ users: ['John', 'Jane'] });
});
app.listen(3000, () => {
console.log('Server running on port 3000');
});
constructor(apiKey: string)
apiKey: Your UsageFlow API key (required)Creates Express middleware for tracking API usage. The middleware automatically tracks all routes and handles route configuration through the UsageFlow dashboard.
createMiddleware(): (req: Request, res: Response, next: NextFunction) => Promise<void>
// Simple usage - tracks all routes automatically
const usageFlow = new ExpressUsageFlowAPI('YOUR_API_KEY');
app.use(usageFlow.createMiddleware());
Route configuration (which routes to track, whitelist, etc.) is managed through the UsageFlow dashboard, not through code parameters.
The middleware automatically collects the following metadata for each request:
If an allocation request fails, the middleware will:
blocked: true in the response body// Error response format
{
message: "Error message",
blocked: true
}
The middleware automatically extracts route patterns from Express. It supports:
req.route.path)/users/:id)The middleware automatically generates ledger IDs based on:
@usageflow/core: Core UsageFlow functionalityexpress: Express.js framework# Install dependencies
npm install
# Build the package
npm run build
# Run tests
npm test
MIT
For issues, questions, or contributions, please visit our GitHub repository.
FAQs
UsageFlow plugin for Express applications
The npm package @usageflow/express receives a total of 12 weekly downloads. As such, @usageflow/express popularity was classified as not popular.
We found that @usageflow/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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.