🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

@nosecone/next

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nosecone/next

Protect your Next.js application with secure headers

latest
Source
npmnpm
Version
1.4.0
Version published
Weekly downloads
49K
9.22%
Maintainers
2
Weekly downloads
 
Created
Source
Arcjet Logo

@nosecone/next

npm badge

Protect your Next.js application with secure headers.

What is this?

This is our adapter to integrate Nosecone into Next.js. Nosecone makes it easy to add and configure security headers. This package exists so that we can provide the best possible experience to Next users.

When should I use this?

You can use this package with or without Arcjet to protect your app if you are using Next.js. Use @nosecone/sveltekit if you use Sveltekit and use nosecone itself if you use a different framework.

Install

This package is ESM only. Install with npm in Node.js:

npm install @nosecone/next

Use

Configure Nosecone in a middleware.ts file:

import { createMiddleware } from "@nosecone/next";

export const config = {
  // matcher tells Next.js to run middleware on all routes
  matcher: ["/(.*)"],
};

export default createMiddleware();

…then use connection from next/server in app/layout.tsx:

+import { connection } from "next/server";

 export default async function RootLayout({
   children,
 }: {
   children: React.ReactNode;
 }) {
+  // Opt-out of static generation for every page so the CSP nonce can be applied
+  await connection()

   return (
     <html lang="en">
       <body className={inter.className}>{children}</body>
     </html>
   );
 }

License

Apache License, Version 2.0 © Arcjet Labs, Inc.

Keywords

arcjet

FAQs

Package last updated on 14 Apr 2026

Did you know?

Socket

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.

Install

Related posts