
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@foomo/next-instrumentation
Advanced tools
Opinionated Next.js instrumentation library.
npm install -S @foomo/next-instrumentation
Create a instrumentation.ts file in your project root and past the following code:
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
// load dependencies
await require('pino');
await require('next-logger');
// register instrumentation
await (await import('@foomo/next-instrumentation/server')).register();
}
}
The DevProxyConfig type defines the following options:
export type DevProxyConfig = {
debug?: boolean; // Enable debug logging
disable?: boolean; // Disable the proxy entirely
remoteUrl: string | ((request: NextRequest) => string); // Remote URL or function to generate it
allowResponseCompression?: boolean; // Allow response compression (default: false)
overrideHostHeader?: boolean; // Override host header (default: true)
overrideCookieDomain?: false | string; // Domain to use for cookies or false to disable
basicAuth?: {
authHeader: string; // Authorization header value
};
cfTokenAuth?: {
clientId: string;
clientSecret: string;
};
};
Here's an example of how to use the middleware in your middleware.ts file:
import {
createProxyMiddleware,
DevProxyConfig,
} from "@foomo/next-instrumentation";
const proxyConfig: DevProxyConfig = {
remoteUrl: "https://api.example.com",
basicAuth: {
authHeader: "Basic abc123==",
},
overrideCookieDomain: "example.com",
};
export function middleware(request: NextRequest) {
if (request.nextUrl.pathname.match("^/(api|webhooks)/")) {
return proxyMiddleware(request);
}
return request;
}
export const config = {
matcher: ["/api/:path*"],
};
const proxyMiddleware = createProxyMiddleware(proxyConfig);
Contributions are welcome! Please fork the repository and submit a pull request.
Distributed under MIT License, please see license file within the code for more details.
FAQs
Unknown package
We found that @foomo/next-instrumentation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.