Back to Next Js

Content Security Policy with Nonce

examples/with-strict-csp/README.md

16.2.51.1 KB
Original Source

Content Security Policy with Nonce

This example shows how to create a Next.js application that sets a strict Content Security Policy (CSP) for your pages, including generating a dynamic nonce.

Deploy your own

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

bash
npx create-next-app --example with-strict-csp with-strict-csp-app
bash
yarn create next-app --example with-strict-csp with-strict-csp-app
bash
pnpm create next-app --example with-strict-csp with-strict-csp-app

Deploy it to the cloud with Vercel (Documentation).