This fork supports next 14, converts to typescript, gets test coverage up to 100%.
npm install next-safe-tsThis fork supports next 14, converts to typescript, gets test coverage up to 100%.
It'll also error if you use none or * on a permissions-policy along with other values.
next-safe[![Version][version-badge]][package]
[![Bundle size][bundlephobia-badge]][bundlephobia]
[![Downloads][downloads-badge]][npmtrends]
[![BSD-3-Clause License][license-badge]][license]
[![Release status][release-status-badge]][release-status]
[![Test status][test-status-badge]][test-status]
[![Code Coverage][coveralls-badge]][coveralls]
[![Maintainability][codeclimate-badge]][codeclimate]
[![PRs Welcome][prs-badge]][prs]

[![Code of Conduct][code-of-conduct-badge]][code-of-conduct]
[![Watch on GitHub][github-watch-badge]][github-watch]
[![Star on GitHub][github-star-badge]][github-star]
[![Tweet][twitter-badge]][twitter]
next-safe helps secure your Next.js apps by providing sensible defaults for the most common security headers, including:
- Content-Security-Policy
- Permissions-Policy (formerly known as Feature-Policy)
- Referrer-Policy
- X-Content-Type-Options
- X-Frame-Options
Check out the full documentation at https://trezy.gitbook.io/next-safe.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome! Check out our contributing docs for help getting started!
[bundlephobia]: https://bundlephobia.com/package/next-safe
[bundlephobia-badge]: https://img.shields.io/bundlephobia/minzip/next-safe?style=flat-square
[code-of-conduct]: CODE_OF_CONDUCT.md
[code-of-conduct-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
[codeclimate]: https://codeclimate.com/github/trezy/next-safe
[codeclimate-badge]: https://img.shields.io/codeclimate/maintainability/trezy/next-safe.svg?style=flat-square
[coveralls]: https://coveralls.io/github/trezy/next-safe
[coveralls-badge]: https://img.shields.io/coveralls/trezy/next-safe.svg?style=flat-square
[downloads-badge]: https://img.shields.io/npm/dm/next-safe.svg?style=flat-square
[github-watch]: https://github.com/trezy/next-safe/watchers
[github-watch-badge]: https://img.shields.io/github/watchers/trezy/next-safe.svg?style=social
[github-star]: https://github.com/trezy/next-safe/stargazers
[github-star-badge]: https://img.shields.io/github/stars/trezy/next-safe.svg?style=social
[license]: LICENSE
[license-badge]: https://img.shields.io/npm/l/next-safe.svg?style=flat-square
[npmtrends]: https://www.npmtrends.com/next-safe
[package]: https://npmjs.com/package/next-safe
[prs]: CONTRIBUTING.md
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[release-status]: https://github.com/trezy/next-safe/actions/workflows/release.yml
[release-status-badge]: https://img.shields.io/github/workflow/status/trezy/next-safe/Release?style=flat-square&label=release
[test-status]: https://github.com/trezy/next-safe/actions/workflows/test.yml
[test-status-badge]: https://img.shields.io/github/workflow/status/trezy/next-safe/Test?style=flat-square&label=tests
[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20trezy/next-safe%20by%20%40PokebagApp%20https%3A%2F%2Fgithub.com%2FPokebag%2Fdata-sdk%20%F0%9F%91%8D
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/trezy/next-safe.svg?style=social
[version-badge]: https://img.shields.io/npm/v/next-safe.svg?style=flat-square