
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@centinel/nextjs
Advanced tools
Package designed to add Centinel Analytica functionality to Next.js applications
Bot protection middleware for Next.js applications.
npm install @centinel/nextjs
CENTINEL_SITE_KEY=your_site_key_here
CENTINEL_SECRET_KEY=your_secret_key_here
NEXT_PUBLIC_CENTINEL_SITE_KEY=your_site_key_here
// app/layout.tsx
import { CentinelLayout } from '@centinel/nextjs';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html>
<body>
<CentinelLayout siteKey={process.env.CENTINEL_SITE_KEY!}>
{children}
</CentinelLayout>
</body>
</html>
);
}
import { createCentinelMiddlewareFromEnv } from '@centinel/nextjs';
import { NextRequest } from 'next/server';
const centinelMiddleware = createCentinelMiddlewareFromEnv();
export default async function middleware(request: NextRequest) {
const result = await centinelMiddleware(request);
return result.response;
}
export const config = {
matcher: ['/api/:path*', '/dashboard/:path*']
};
import { createCentinelMiddleware } from '@centinel/nextjs';
import { NextRequest, NextResponse } from 'next/server';
const centinelMiddleware = createCentinelMiddleware({
siteKey: process.env.CENTINEL_SITE_KEY!,
secretKey: process.env.CENTINEL_SECRET_KEY!
});
export default async function middleware(request: NextRequest) {
const result = await centinelMiddleware(request);
if (result.should_intercept) {
return result.response;
}
// Your other middleware logic
return NextResponse.next();
}
export const config = {
matcher: ['/api/:path*', '/dashboard/:path*']
};
// app/api/login/route.ts
import { createRequestValidatorFromEnv } from '@centinel/nextjs';
import { NextRequest, NextResponse } from 'next/server';
const { isBot } = createRequestValidatorFromEnv();
export async function POST(request: NextRequest) {
if (await isBot(request)) {
return NextResponse.json({ error: 'Blocked' }, { status: 403 });
}
return handleLogin(request);
}
interface CentinelResult {
response: NextResponse;
decision: 'allow' | 'block' | 'redirect' | 'not_matched';
should_intercept: boolean;
}
should_intercept: true → block or redirect (return immediately)should_intercept: false → allow or not_matched (continue)import { CentinelMiddleware } from '@centinel/nextjs';
const centinel = new CentinelMiddleware({
siteKey: process.env.CENTINEL_SITE_KEY!,
secretKey: process.env.CENTINEL_SECRET_KEY!,
timeout: 1000, // ms (default: 500)
debugMode: true
});
const result = await centinel.validate({ request });
export async function POST(request: NextRequest) {
if (!request.cookies.get('_centinel')) {
return NextResponse.json({ error: 'Blocked' }, { status: 403 });
}
// ...
}
FAQs
Package designed to add Centinel Analytica functionality to Next.js applications
The npm package @centinel/nextjs receives a total of 354 weekly downloads. As such, @centinel/nextjs popularity was classified as not popular.
We found that @centinel/nextjs 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

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.