Skip to content

Arcjet Nosecone: Security headers for JS frameworks

npm badge

Arcjet Nosecone is an open source library that helps set security headers such as Content-Security-Policy (CSP), Strict-Transport-Security (HSTS), and X-Content-Type-Options in JS applications built with Bun, Deno, Next.js, Node.js, or SvelteKit.

What are Arcjet utilities?

Arcjet utilities are independent libraries that do not require the use of the main Arcjet SDK—they can be used with or without other Arcjet rules.

We take the pain out of implementing security tasks through these utilities to provide a security as code approach to developer-first security.

Supported headers

Nosecone makes it easy to add and configure these headers:

  • Content-Security-Policy (CSP)
  • Cross-Origin-Embedder-Policy (COEP)
  • Cross-Origin-Opener-Policy
  • Cross-Origin-Resource-Policy
  • Origin-Agent-Cluster
  • Referrer-Policy
  • Strict-Transport-Security (HSTS)
  • X-Content-Type-Options
  • X-DNS-Prefetch-Control
  • X-Download-Options
  • X-Frame-Options
  • X-Permitted-Cross-Domain-Policies
  • X-XSS-Protection

See the reference guide for full details on each option.

Quick start

This guide will show you how to add our recommended default security headers.

1. Install Nosecone

In your project root, run the following command to install the Arcjet Nosecone library for your framework:

2. Configure your application

3. Run your application

4. Inspect the headers

The default headers apply a pragmatic set of security headers to your application, but may break things (particularly the CSP header).

We recommend you test your application thoroughly and tweak the settings to ensure it continues to work as expected.

What next?

Get help

Need help with anything? Email support@arcjet.com to get support from our engineering team, join our Discord, or open an issue on GitHub.

Discussion