vite-plugin-csp weekly downloads statistics
By josh-hemphill · npm · Vite plugins
Create CSP meta tags and header configs from all sources in the final Vite html
vite-plugin-csp has 11,651 recorded weekly downloads on npm, a decrease of 25.9% over the past 30 days, ranking #922 of 2,322 tracked listings.
About vite-plugin-csp
CSP (Content-Security-Policy) Vite Plugin
<!-- cspell: disable bracketsstartstop -->Leverages csp-typed-directives to create typed CSP <meta> policies and validated interdependant headers.
e.g. the CSP, CSP Report-Only, Report-To, and Referrer-Policy headers.
Mostly config compatible with csp-html-webpack-plugin
WARNING, STILL EARLY AND THINGS LIKE MODULE RESOLUTION ARE FINICKY
Now looking at making a multi-repo because this is going to require multiple layers of shared functionality and also built to an unplugin
Installation
Install the plugin with npm:
$ npm install --save-dev vite-plugin-csp
# Or shorthand
npm i -D vite-plugin-csp
Known issues
- Relative modules are resolved relative to the CWD, not the file
- no SSR support (and thus no nonce support)
- No parsing of JS embeded sources (since that would require framework specific plugins)
- Only
scriptandstylerelated directives are supported (except for the inclusion ofreport-tofor generating headers)
Under construction :)
<!-- ## Zero Config Usage Add your base logo as `logo.png` file to your assets folder. Add the plugin to your vite config as follows: ```javascript const ViteCspPlugin = require('vite-plugin-csp') // or ESM import { ViteCspPlugin } from "module"; plugins: [ ViteCspPlugin() ] ``` ## Basic Usage <!-- [<svg alt="codesandbox" xmlns="http://www.w3.org/2000/svg" width="16" height="18"><path d="M7.219 15.877V9.394l-5.73-3.208v3.696l2.624 1.48v2.78l3.106 1.735zm1.488.038l3.163-1.773v-2.845l2.642-1.49V6.16l-5.805 3.26v6.496zm5.041-11l-3.05-1.72-2.68 1.512L5.32 3.193 2.241 4.937l5.744 3.215 5.763-3.237zM0 13.513V4.53L8 0l8 4.511V13.5l-8.001 4.484L0 13.513z" fill="currentColor"/></svg>](https://codesandbox.io/s/vite-plugin-csp-demo-uh195?file=/webpack.config.js) --> <!-- Add the plugin to your vite config as follows: ```javascript const ViteCspPlugin = require('vite-plugin-csp') // or ESM import { ViteCspPlugin } from "module"; ... plugins: [ ViteCspPlugin('/path/to/logo.png') // svg works too! ] ``` The default configuration will automatically generate webapp manifest files along with [44 different icon formats](https://github.com/josh-hemphill/vite-plugin-csp/tree/master/test/fixtures/expected/default) as appropriate for iOS devices, Android devices, Windows Phone and various desktop browsers out of your single `logo.png`. > **Tip:** You might want to [fine tune](#advanced-usage) what vendors to support. ### A Note on Path Resolution Under the hood, Vite/Rollup resolve the paths to the logo and favicons according to the following rules: * If `/path/to/logo` is absolute, there is nothing to resolve and the path specified is used as is. * If `./path/to/logo` is relative, it's resolved with respect to `process.cwd()`. ### HTML Injection In combination with [Vite's html plugin hooks](https://vitejs.dev/guide/api-plugin.html#transformindexhtml) it will also inject the necessary html for you:…Description from the npm listing.
- vite-plugin
- CSP
- CSPs
- header
- security
- generate
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (543)Similar npm Vite plugins plugins
All 20 vite-plugin-csp alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/vite-plugin-csp. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.